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;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -15,6 +15,10 @@ export interface Item {
|
||||
labels_data?: string;
|
||||
serial_number?: string;
|
||||
type?: string;
|
||||
description?: string;
|
||||
connector?: string;
|
||||
size?: string;
|
||||
ocr_text?: string;
|
||||
}
|
||||
|
||||
export interface PendingOperation {
|
||||
@@ -34,8 +38,8 @@ export class InventoryDatabase extends Dexie {
|
||||
|
||||
constructor() {
|
||||
super('InventoryDatabase');
|
||||
this.version(4).stores({
|
||||
items: '++id, barcode, name, category, part_number, color, box_label',
|
||||
this.version(5).stores({
|
||||
items: '++id, barcode, name, category, part_number, color, box_label, ocr_text',
|
||||
pendingOperations: '++id, barcode, timestamp, synced, uuid'
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user