updates
This commit is contained in:
@@ -107,6 +107,7 @@ export interface CompanySettingsResponse {
|
||||
company_phone: string;
|
||||
company_email: string;
|
||||
company_address: string;
|
||||
tax_rate: number;
|
||||
updated_at?: string | null;
|
||||
updated_by?: string | null;
|
||||
};
|
||||
@@ -119,6 +120,7 @@ export interface UpdateCompanySettingsRequest {
|
||||
company_phone?: string;
|
||||
company_email?: string;
|
||||
company_address?: string;
|
||||
tax_rate?: number;
|
||||
}
|
||||
|
||||
export interface UploadLogoResponse {
|
||||
@@ -139,6 +141,49 @@ export interface UploadFaviconResponse {
|
||||
};
|
||||
}
|
||||
|
||||
export interface RecaptchaSettingsResponse {
|
||||
status: string;
|
||||
data: {
|
||||
recaptcha_site_key: string;
|
||||
recaptcha_enabled: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface RecaptchaSettingsAdminResponse {
|
||||
status: string;
|
||||
data: {
|
||||
recaptcha_site_key: string;
|
||||
recaptcha_secret_key: string;
|
||||
recaptcha_secret_key_masked: string;
|
||||
recaptcha_enabled: boolean;
|
||||
has_site_key: boolean;
|
||||
has_secret_key: boolean;
|
||||
updated_at?: string | null;
|
||||
updated_by?: string | null;
|
||||
};
|
||||
}
|
||||
|
||||
export interface UpdateRecaptchaSettingsRequest {
|
||||
recaptcha_site_key?: string;
|
||||
recaptcha_secret_key?: string;
|
||||
recaptcha_enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface VerifyRecaptchaRequest {
|
||||
token: string;
|
||||
}
|
||||
|
||||
export interface VerifyRecaptchaResponse {
|
||||
status: string;
|
||||
data: {
|
||||
verified: boolean;
|
||||
score?: number;
|
||||
action?: string;
|
||||
error_codes?: string[];
|
||||
message?: string;
|
||||
};
|
||||
}
|
||||
|
||||
const systemSettingsService = {
|
||||
/**
|
||||
* Get platform currency (public endpoint)
|
||||
@@ -311,7 +356,56 @@ const systemSettingsService = {
|
||||
},
|
||||
};
|
||||
|
||||
const recaptchaService = {
|
||||
/**
|
||||
* Get reCAPTCHA settings (public endpoint)
|
||||
*/
|
||||
getRecaptchaSettings: async (): Promise<RecaptchaSettingsResponse> => {
|
||||
const response = await apiClient.get<RecaptchaSettingsResponse>(
|
||||
'/api/admin/system-settings/recaptcha'
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get reCAPTCHA settings (admin only)
|
||||
*/
|
||||
getRecaptchaSettingsAdmin: async (): Promise<RecaptchaSettingsAdminResponse> => {
|
||||
const response = await apiClient.get<RecaptchaSettingsAdminResponse>(
|
||||
'/api/admin/system-settings/recaptcha/admin'
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Update reCAPTCHA settings (admin only)
|
||||
*/
|
||||
updateRecaptchaSettings: async (
|
||||
settings: UpdateRecaptchaSettingsRequest
|
||||
): Promise<RecaptchaSettingsAdminResponse> => {
|
||||
const response = await apiClient.put<RecaptchaSettingsAdminResponse>(
|
||||
'/api/admin/system-settings/recaptcha',
|
||||
settings
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Verify reCAPTCHA token
|
||||
*/
|
||||
verifyRecaptcha: async (
|
||||
token: string
|
||||
): Promise<VerifyRecaptchaResponse> => {
|
||||
const response = await apiClient.post<VerifyRecaptchaResponse>(
|
||||
'/api/admin/system-settings/recaptcha/verify',
|
||||
{ token }
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
|
||||
export default systemSettingsService;
|
||||
export { recaptchaService };
|
||||
|
||||
export type {
|
||||
PlatformCurrencyResponse,
|
||||
@@ -328,5 +422,10 @@ export type {
|
||||
UpdateCompanySettingsRequest,
|
||||
UploadLogoResponse,
|
||||
UploadFaviconResponse,
|
||||
RecaptchaSettingsResponse,
|
||||
RecaptchaSettingsAdminResponse,
|
||||
UpdateRecaptchaSettingsRequest,
|
||||
VerifyRecaptchaRequest,
|
||||
VerifyRecaptchaResponse,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user