mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 09:13:14 +03:00
refactor(server): trash endpoints (#6652)
* refactor(server): trash endpoints * chore: open api * chore: fix wrong rename
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
ServerInfoApi,
|
||||
SharedLinkApi,
|
||||
SystemConfigApi,
|
||||
TrashApi,
|
||||
UserApi,
|
||||
UserApiFp,
|
||||
base,
|
||||
@@ -46,6 +47,7 @@ class ImmichApi {
|
||||
public personApi: PersonApi;
|
||||
public systemConfigApi: SystemConfigApi;
|
||||
public userApi: UserApi;
|
||||
public trashApi: TrashApi;
|
||||
|
||||
private config: configuration.Configuration;
|
||||
private key?: string;
|
||||
@@ -75,6 +77,7 @@ class ImmichApi {
|
||||
this.personApi = new PersonApi(this.config);
|
||||
this.systemConfigApi = new SystemConfigApi(this.config);
|
||||
this.userApi = new UserApi(this.config);
|
||||
this.trashApi = new TrashApi(this.config);
|
||||
}
|
||||
|
||||
private createUrl(path: string, params?: Record<string, unknown>) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
try {
|
||||
const ids = Array.from(getAssets()).map((a) => a.id);
|
||||
await api.assetApi.restoreAssets({ bulkIdsDto: { ids } });
|
||||
await api.trashApi.restoreAssets({ bulkIdsDto: { ids } });
|
||||
onRestore?.(ids);
|
||||
|
||||
notificationController.show({
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
const handleEmptyTrash = async () => {
|
||||
isShowEmptyConfirmation = false;
|
||||
try {
|
||||
await api.assetApi.emptyTrash();
|
||||
await api.trashApi.emptyTrash();
|
||||
|
||||
notificationController.show({
|
||||
message: `Empty trash initiated. Refresh the page to see the changes`,
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
const handleRestoreTrash = async () => {
|
||||
try {
|
||||
await api.assetApi.restoreTrash();
|
||||
await api.trashApi.restoreTrash();
|
||||
|
||||
notificationController.show({
|
||||
message: `Restore trash initiated. Refresh the page to see the changes`,
|
||||
|
||||
Reference in New Issue
Block a user