ปรับแสดง error ใน mixin validation errors
This commit is contained in:
parent
c358789bed
commit
6e1a72db63
1 changed files with 12 additions and 0 deletions
|
|
@ -375,6 +375,18 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
onlycancel: true,
|
||||
},
|
||||
});
|
||||
} else if (e.response.data.status == 400 && e.response.data.title) {
|
||||
//validation errors
|
||||
q.dialog({
|
||||
component: CustomComponent,
|
||||
componentProps: {
|
||||
title: `พบข้อผิดพลาด`,
|
||||
message: `${e.response.data.title}`,
|
||||
icon: "warning",
|
||||
color: "red",
|
||||
onlycancel: true,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
const message = e.response.data.result ?? e.response.data.message;
|
||||
q.dialog({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue