mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
🛠️ Fix include optimize param in API request
The optimize parameter was missing from the API request payload. The API endpoint defaulted to optimization enabled because `body.optimize !== false` (svgr/+server.ts:L18) evaluates to `true` when `undefined`, removing gradients even when users disabled optimization.
This commit is contained in:
@@ -162,7 +162,12 @@
|
||||
content = prefixSvgIds(content, getPrefixFromSvgUrl(svgUrlToCopy));
|
||||
}
|
||||
|
||||
const dataComponent = { code: content, typescript: tsx, name: title };
|
||||
const dataComponent = {
|
||||
code: content,
|
||||
typescript: tsx,
|
||||
name: title,
|
||||
optimize,
|
||||
};
|
||||
const { data, error } = await getReactCode(dataComponent);
|
||||
|
||||
if (error || !data) {
|
||||
|
||||
Reference in New Issue
Block a user