Fixes for API logo issues
This commit is contained in:
@@ -18,14 +18,23 @@ export async function shortenUrl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const base = env.KUTT_BASE_URL.replace(/\/$/, '');
|
const base = env.KUTT_BASE_URL.replace(/\/$/, '');
|
||||||
|
const apiKey = env.KUTT_API_KEY.trim();
|
||||||
|
|
||||||
|
// Extract domain from SHORT_DOMAIN (e.g., "https://mifi.me" -> "mifi.me")
|
||||||
|
const domain = env.SHORT_DOMAIN.replace(/^https?:\/\//, '').replace(
|
||||||
|
/\/$/,
|
||||||
|
'',
|
||||||
|
);
|
||||||
|
|
||||||
const res = await fetch(`${base}/api/v2/links`, {
|
const res = await fetch(`${base}/api/v2/links`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'X-API-Key': env.KUTT_API_KEY,
|
'X-API-Key': apiKey,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
target: body.targetUrl,
|
target: body.targetUrl,
|
||||||
|
domain: domain,
|
||||||
...(body.customSlug && { customurl: body.customSlug }),
|
...(body.customSlug && { customurl: body.customSlug }),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1020,19 +1020,7 @@ export function Editor({ id }: EditorProps) {
|
|||||||
updateProject({ recipeJson: JSON.stringify(r) });
|
updateProject({ recipeJson: JSON.stringify(r) });
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Select
|
{/* Shape select removed - circle shape has rendering issues in qr-code-styling library */}
|
||||||
label="Shape"
|
|
||||||
data={[
|
|
||||||
{ value: 'square', label: 'Square' },
|
|
||||||
{ value: 'circle', label: 'Circle' },
|
|
||||||
]}
|
|
||||||
value={recipe.shape ?? 'square'}
|
|
||||||
onChange={(v) => {
|
|
||||||
const r = { ...recipe };
|
|
||||||
r.shape = (v as 'square' | 'circle') ?? 'square';
|
|
||||||
updateProject({ recipeJson: JSON.stringify(r) });
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Group grow>
|
<Group grow>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
label="Margin"
|
label="Margin"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export function buildQrStylingOptions(
|
|||||||
data: overrides.data ?? recipe.data ?? ' ',
|
data: overrides.data ?? recipe.data ?? ' ',
|
||||||
image: overrides.image,
|
image: overrides.image,
|
||||||
type: 'canvas',
|
type: 'canvas',
|
||||||
shape: recipe.shape ?? 'square',
|
shape: 'square', // circle shape has rendering issues in qr-code-styling library
|
||||||
margin: recipe.margin ?? 0,
|
margin: recipe.margin ?? 0,
|
||||||
qrOptions: {
|
qrOptions: {
|
||||||
type: 'canvas',
|
type: 'canvas',
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export interface RecipeOptions {
|
|||||||
type?: string;
|
type?: string;
|
||||||
gradient?: QrGradient;
|
gradient?: QrGradient;
|
||||||
};
|
};
|
||||||
shape?: 'square' | 'circle';
|
// shape removed - circle shape has rendering issues in qr-code-styling library
|
||||||
margin?: number;
|
margin?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user