Skip to content

Commit

Permalink
add titles to Toasts for GenericItem
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed May 23, 2024
1 parent 09a91e0 commit 1e94915
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions client/src/components/History/Content/GenericItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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");
}
},
},
Expand Down

0 comments on commit 1e94915

Please sign in to comment.