From 03ff8947151c1b45d3e34fc38f95486d1fc8f60f Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Wed, 13 Sep 2023 11:40:57 +0200 Subject: [PATCH] call correct method on data source --- .../documents/repository/document.repository.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/repository/document.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/repository/document.repository.ts index 7cf99b0a33..cddeb039ab 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/repository/document.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/repository/document.repository.ts @@ -254,14 +254,11 @@ export class UmbDocumentRepository return { error }; } - // Listing all currently known methods we need to implement: - // these currently only covers posting data - // TODO: find a good way to split these async trash(id: string) { if (!id) throw new Error('Id is missing'); await this.#init; - const { error } = await this.#detailDataSource.delete(id); + const { error } = await this.#detailDataSource.trash(id); if (!error) { // TODO: we currently don't use the detail store for anything. @@ -273,6 +270,8 @@ export class UmbDocumentRepository this.#treeStore?.removeItem(id); this.#itemStore?.removeItem(id); + // TODO: append to recycle bin store + const notification = { data: { message: `Document moved to recycle bin` } }; this.#notificationContext?.peek('positive', notification); } @@ -280,6 +279,9 @@ export class UmbDocumentRepository return { error }; } + // Listing all currently known methods we need to implement: + // these currently only covers posting data + // TODO: find a good way to split these async saveAndPublish() { alert('save and publish'); }