добавил архив фото, откуда можно удалить и посмотреть

This commit is contained in:
2026-01-19 05:17:15 +03:00
parent bc036197cf
commit 323fc67cd5
12 changed files with 648 additions and 26 deletions

View File

@@ -25,7 +25,8 @@ import type {
UnifiedInvoice,
ServerUser,
UserRole,
InvoiceDetails
InvoiceDetails,
GetPhotosResponse
} from './types';
// Базовый URL
@@ -255,4 +256,21 @@ export const api = {
syncInvoices: async (): Promise<void> => {
await apiClient.post('/invoices/sync');
},
};
getPhotos: async (page = 1, limit = 20): Promise<GetPhotosResponse> => {
const { data } = await apiClient.get<GetPhotosResponse>('/photos', {
params: { page, limit }
});
return data;
},
deletePhoto: async (id: string, force = false): Promise<void> => {
await apiClient.delete(`/photos/${id}`, {
params: { force }
});
},
regenerateDraftFromPhoto: async (id: string): Promise<void> => {
await apiClient.post(`/photos/${id}/regenerate`);
},
};