mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-12-23 13:13:00 +00:00
Advent22.alert_user_error: Use bulma-toast
This commit is contained in:
parent
785c74fd7b
commit
4e66d304e5
3 changed files with 9 additions and 4 deletions
|
@ -107,7 +107,7 @@ export default class extends Vue {
|
|||
this.multi_modal!.show_image(image_src, this.$advent22.name_door(day));
|
||||
})
|
||||
.catch((error) => {
|
||||
alert(error);
|
||||
this.$advent22.alert_user_error(error);
|
||||
this.multi_modal!.hide();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ import { DoorSaved } from "@/lib/api";
|
|||
import { Door } from "@/lib/door";
|
||||
import { Options, Vue } from "vue-class-component";
|
||||
|
||||
import { toast } from "bulma-toast";
|
||||
import Calendar from "../Calendar.vue";
|
||||
import BulmaBreadcrumbs, { Step } from "../bulma/Breadcrumbs.vue";
|
||||
import BulmaButton from "../bulma/Button.vue";
|
||||
|
@ -149,7 +150,7 @@ export default class extends Vue {
|
|||
this.loading_doors = true;
|
||||
|
||||
this.load_doors()
|
||||
.then(() => alert("Erfolgreich!"))
|
||||
.then(() => toast({ message: "Erfolgreich!", type: "is-success" }))
|
||||
.catch(() => {})
|
||||
.finally(() => (this.loading_doors = false));
|
||||
}
|
||||
|
@ -169,7 +170,7 @@ export default class extends Vue {
|
|||
this.save_doors()
|
||||
.then(() => {
|
||||
this.load_doors()
|
||||
.then(() => alert("Erfolgreich!"))
|
||||
.then(() => toast({ message: "Erfolgreich!", type: "is-success" }))
|
||||
.catch(() => {})
|
||||
.finally(() => (this.saving_doors = false));
|
||||
})
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import axios, { AxiosError, AxiosInstance, ResponseType } from "axios";
|
||||
import { toast } from "bulma-toast";
|
||||
import { App, Plugin } from "vue";
|
||||
import { advent22Store } from "./store";
|
||||
|
||||
|
@ -78,7 +79,10 @@ export class Advent22 {
|
|||
}
|
||||
|
||||
public alert_user_error(param: [unknown, string]): void {
|
||||
alert(this.format_user_error(param));
|
||||
toast({
|
||||
message: this.format_user_error(param),
|
||||
type: "is-danger",
|
||||
});
|
||||
}
|
||||
|
||||
public api_url(): string;
|
||||
|
|
Loading…
Reference in a new issue