feat: photo multiselect, move/copy, trash and compact chrome
- backend: soft delete + trash (photos.deleted_at, migration 000005), GET /trash, restore, permanent delete with storage-key refcount (S3 objects removed only when no other album references them); batch endpoints photo-batch/{delete,move,copy} - metadata only, copies clone rows sharing storage keys
- frontend: Ctrl/Shift multiselect; right-panel 'Действия' as icon text rows (Открыть (просмотр), Переместить, Копировать, Удалить); drag selected photos onto rail album -> TransferDialog; /trash route; trash entry as last item in the left rail; empty right panel hidden on overview
- frontend: compact top bars (app header and viewer), compact theme switcher
- openspec: sync lightroom-workspace-ui artifacts (photos/ui-workspace specs, design #20-24, tasks 9.11-9.17)
This commit is contained in:
+19
-1
@@ -1,6 +1,6 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { auth, type Tokens, type User } from './stores/auth.svelte';
|
||||
import type { Preferences } from './types';
|
||||
import type { Photo, Preferences } from './types';
|
||||
|
||||
export class ApiError extends Error {
|
||||
status: number;
|
||||
@@ -105,3 +105,21 @@ export const authApi = {
|
||||
body: preferences
|
||||
})
|
||||
};
|
||||
|
||||
export const photosApi = {
|
||||
deleteBatch: (ids: string[]) =>
|
||||
api<{ deleted: number }>('/photo-batch/delete', { method: 'POST', body: { ids } }),
|
||||
moveBatch: (ids: string[], albumId: string) =>
|
||||
api<{ moved: number }>('/photo-batch/move', {
|
||||
method: 'POST',
|
||||
body: { ids, album_id: albumId }
|
||||
}),
|
||||
copyBatch: (ids: string[], albumId: string) =>
|
||||
api<{ photos: Photo[] }>('/photo-batch/copy', {
|
||||
method: 'POST',
|
||||
body: { ids, album_id: albumId }
|
||||
}),
|
||||
trash: () => api<{ photos: Photo[] }>('/trash'),
|
||||
restore: (id: string) => api<{ photo: Photo }>(`/photos/${id}/restore`, { method: 'POST' }),
|
||||
permanentDelete: (id: string) => api(`/photos/${id}/permanent`, { method: 'DELETE' })
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user