From 6e1a72db63213146aed8486180d207902c75a77b Mon Sep 17 00:00:00 2001 From: waruneeta Date: Wed, 27 Dec 2023 15:16:35 +0700 Subject: [PATCH 2/2] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B9=81=E0=B8=AA=E0=B8=94=E0=B8=87=20error=20=E0=B9=83?= =?UTF-8?q?=E0=B8=99=20mixin=20validation=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/mixin.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index d5b93d965..70016eb7c 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -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({