web: Improve error handling in deleteform
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
bc37480f0d
commit
013a192485
|
@ -1,6 +1,7 @@
|
||||||
import { gettext } from "django";
|
import { gettext } from "django";
|
||||||
import { customElement, html, property, TemplateResult } from "lit-element";
|
import { customElement, html, property, TemplateResult } from "lit-element";
|
||||||
import { ModalButton } from "../buttons/ModalButton";
|
import { ModalButton } from "../buttons/ModalButton";
|
||||||
|
import { showMessage } from "../messages/MessageContainer";
|
||||||
|
|
||||||
@customElement("ak-forms-delete")
|
@customElement("ak-forms-delete")
|
||||||
export class DeleteForm extends ModalButton {
|
export class DeleteForm extends ModalButton {
|
||||||
|
@ -23,7 +24,12 @@ export class DeleteForm extends ModalButton {
|
||||||
composed: true,
|
composed: true,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
}).catch((e) => {
|
||||||
|
showMessage({
|
||||||
|
message: gettext(`Failed to delete ${this.objectLabel}: ${e.toString()}`),
|
||||||
|
level_tag: "error",
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
renderModalInner(): TemplateResult {
|
renderModalInner(): TemplateResult {
|
||||||
|
|
Reference in New Issue