Build [v1.9.19]
This commit is contained in:
@@ -220,5 +220,32 @@ export const inventoryApi = {
|
||||
updateDbSettings: async (settings: any) => {
|
||||
const res = await axiosInstance.patch('/admin/db/settings', settings);
|
||||
return res.data;
|
||||
},
|
||||
exportDb: async () => {
|
||||
const res = await axiosInstance.get('/admin/db/export', { responseType: 'blob' });
|
||||
return res.data;
|
||||
},
|
||||
importDb: async (formData: FormData) => {
|
||||
const res = await axiosInstance.post('/admin/db/import', formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
});
|
||||
return res.data;
|
||||
},
|
||||
// System Settings
|
||||
getSystemSettings: async () => {
|
||||
// Note: Reusing the existing settings router pattern but adding AI Prompt
|
||||
const res = await axiosInstance.get('/admin/db/settings');
|
||||
// We need another endpoint for general settings or expand the DB one
|
||||
// For now, I'll add a specific fetch for the prompt
|
||||
const promptRes = await axiosInstance.get('/admin/db/settings/prompt');
|
||||
return { ...res.data, ai_extraction_prompt: promptRes.data.value };
|
||||
},
|
||||
getAiPrompt: async () => {
|
||||
const res = await axiosInstance.get('/admin/db/settings/prompt');
|
||||
return res.data;
|
||||
},
|
||||
updateAiPrompt: async (prompt: string) => {
|
||||
const res = await axiosInstance.post('/admin/db/settings/prompt', { value: prompt });
|
||||
return res.data;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user