From ed0eac10e49baa9b05b573ba01eaf9fee732a120 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 7 Feb 2023 13:32:23 +0100 Subject: [PATCH] rename variable --- .../documents/repository/document.repository.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/repository/document.repository.ts b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/repository/document.repository.ts index 053c08f0d4..18eed1dce0 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/repository/document.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/repository/document.repository.ts @@ -166,14 +166,14 @@ export class UmbDocumentRepository implements UmbTreeRepository, UmbDetailReposi return { error }; } - async saveDetail(template: ItemDetailType) { + async saveDetail(document: ItemDetailType) { await this.#init; - if (!template || !template.key) { + if (!document || !document.key) { throw new Error('Template is missing'); } - const { error } = await this.#detailDataSource.update(template); + const { error } = await this.#detailDataSource.update(document); if (!error) { const notification = { data: { message: `Document saved` } }; @@ -183,8 +183,9 @@ export class UmbDocumentRepository implements UmbTreeRepository, UmbDetailReposi // TODO: we currently don't use the detail store for anything. // Consider to look up the data before fetching from the server // Consider notify a workspace if a template is updated in the store while someone is editing it. - this.#detailStore?.append(template); - this.#treeStore?.updateItem(template.key, { name: template.name }); + this.#detailStore?.append(document); + this.#treeStore?.updateItem(document.key, { name: document.name }); + // TODO: would be nice to align the stores on methods/methodNames. return { error };