ปรับ mixin messageError แสดง result ก่อน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-11-10 13:56:18 +07:00
parent f4ee2b89fc
commit 174530e7f9
3 changed files with 4 additions and 3 deletions

View file

@ -16,7 +16,7 @@ import { useQuasar } from "quasar";
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, dialogConfirm, success, messageError } = mixin; const { dialogConfirm, success, messageError } = mixin;
/** propsData จาก RoundMain */ /** propsData จาก RoundMain */
const props = defineProps({ const props = defineProps({

View file

@ -229,7 +229,7 @@ const pagination = ref({
</q-td> </q-td>
<q-td> <q-td>
<q-btn <q-btn
v-if="props.row.isActive === false" v-if="props.row.isDefault === false"
dense dense
flat flat
round round

View file

@ -376,11 +376,12 @@ export const useCounterMixin = defineStore("mixin", () => {
}, },
}); });
} else { } else {
const message = e.response.data.result ?? e.response.data.message;
q.dialog({ q.dialog({
component: CustomComponent, component: CustomComponent,
componentProps: { componentProps: {
title: `พบข้อผิดพลาด`, title: `พบข้อผิดพลาด`,
message: `${e.response.data.message}`, message: `${message}`,
icon: "warning", icon: "warning",
color: "red", color: "red",
onlycancel: true, onlycancel: true,