From 1e94915c98bf1bf3af1d14dd357eec619c7839b2 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Thu, 23 May 2024 10:34:59 -0500 Subject: [PATCH] add titles to `Toast`s for `GenericItem` --- .../src/components/History/Content/GenericItem.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/src/components/History/Content/GenericItem.vue b/client/src/components/History/Content/GenericItem.vue index 0669ee3f866d..5ba543ea0b89 100644 --- a/client/src/components/History/Content/GenericItem.vue +++ b/client/src/components/History/Content/GenericItem.vue @@ -82,33 +82,33 @@ export default { try { await deleteContent(item, { recursive: recursive }); } catch (error) { - this.onError(error); + this.onError(error, "Failed to delete item"); } }, - onError(e) { + onError(e, title = "Error") { const error = errorMessageAsString(e, "Dataset operation failed."); - Toast.error(error); + Toast.error(error, title); console.error(error); }, async onUndelete(item) { try { await updateContentFields(item, { deleted: false }); } catch (error) { - this.onError(error); + this.onError(error, "Failed to undelete item"); } }, async onHide(item) { try { await updateContentFields(item, { visible: false }); } catch (error) { - this.onError(error); + this.onError(error, "Failed to hide item"); } }, async onUnhide(item) { try { await updateContentFields(item, { visible: true }); } catch (error) { - this.onError(error); + this.onError(error, "Failed to unhide item"); } }, async onHighlight(item) { @@ -121,7 +121,7 @@ export default { try { await this.applyFilters(history_id, filters); } catch (error) { - this.onError(error); + this.onError(error, "Failed to highlight related items"); } }, },