feat(F-099): completed feature
This commit is contained in:
@@ -27,10 +27,12 @@ async function request<T>(method: string, path: string, body?: unknown): Promise
|
||||
|
||||
if (!res.ok) {
|
||||
const body = await res.json().catch(() => ({ message: 'Request failed' }));
|
||||
const envelope = body as { code?: string; message?: string; error?: { code?: string; message?: string } };
|
||||
const error = envelope.error ?? envelope;
|
||||
throw new ApiError(
|
||||
res.status,
|
||||
(body as { code?: string }).code ?? 'REQUEST_FAILED',
|
||||
(body as { message?: string }).message ?? 'Request failed',
|
||||
error.code ?? 'REQUEST_FAILED',
|
||||
error.message ?? 'Request failed',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -334,6 +336,14 @@ export interface StoreSettings {
|
||||
aiApiKeyConfigured?: boolean;
|
||||
aiSeoTitlePrompt: string;
|
||||
aiSeoDescriptionPrompt: string;
|
||||
aiProductDescriptionPrompt: string;
|
||||
smtpHost: string;
|
||||
smtpPort: string;
|
||||
smtpSecure: boolean;
|
||||
smtpUser: string;
|
||||
smtpPass: string;
|
||||
smtpPassConfigured?: boolean;
|
||||
smtpFrom: string;
|
||||
}
|
||||
|
||||
export const settingsApi = {
|
||||
|
||||
Reference in New Issue
Block a user