ปรับแสดง error ใน mixin validation errors

This commit is contained in:
Warunee Tamkoo 2023-12-27 15:16:35 +07:00
parent c358789bed
commit 6e1a72db63

View file

@ -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({