check citizenId

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-05-15 09:52:44 +07:00
parent a35309c68b
commit b0e5bc6b46
4 changed files with 30 additions and 14 deletions

View file

@ -30,6 +30,7 @@ const {
} = useCounterMixin();
const { calculateAge } = profileStore;
const modal = defineModel<boolean>("modal", { required: true });
const empType = defineModel<string>("empType", { required: true });
const props = defineProps({
fetchData: { type: Function },
@ -140,8 +141,9 @@ function clearFormData() {
async function onSubmit() {
dialogConfirm($q, async () => {
const type = empType.value !== "officer" ? "-employee" : "";
await http
.post(config.API.registryNew, formData)
.post(config.API.registryNew(type), formData)
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData?.();