refactor(server): trash endpoints (#6652)

* refactor(server): trash endpoints

* chore: open api

* chore: fix wrong rename
This commit is contained in:
Jason Rasmussen
2024-01-26 11:48:37 -05:00
committed by GitHub
parent 33757689fe
commit 96b7885583
27 changed files with 967 additions and 137 deletions

View File

@@ -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>) {

View File

@@ -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({

View File

@@ -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`,