fix:convertDateToAPI

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-10-17 17:22:40 +07:00
parent 97aa731d2f
commit 1fc7882918
8 changed files with 42 additions and 13 deletions

View file

@ -27,6 +27,7 @@ const {
hideLoader,
date2Thai,
calculateDurationYmd,
convertDateToAPI,
} = useCounterMixin();
/**
@ -77,7 +78,12 @@ function onSubmit() {
dialogConfirm($q, () => {
showLoader();
http
.post(config.API.devUploadUser + projectId.value, formData)
.post(config.API.devUploadUser + projectId.value, {
...formData,
dateStart: convertDateToAPI(formData.dateStart),
dateEnd: convertDateToAPI(formData.dateEnd),
commandDate: convertDateToAPI(formData.commandDate),
})
.then(async (res) => {
await props?.fetchData();
tab.value = res.data.result ? "IN" : "OUT";

View file

@ -21,6 +21,7 @@ const {
messageError,
dialogConfirm,
success,
convertDateToAPI,
} = mixin;
const modal = defineModel<boolean>("modal", { required: true });
@ -61,8 +62,8 @@ function onSubmit() {
.put(config.API.devScholarship + `/admin/detail/${id.value}`, {
bookNumber: bookNumber.value,
bookDate: bookDate.value,
governmentDate: governmentDate.value,
governmentEndDate: governmentEndDate.value,
governmentDate: convertDateToAPI(governmentDate.value),
governmentEndDate: convertDateToAPI(governmentEndDate.value),
isGraduated: isGraduated.value,
graduatedDate:
isGraduated.value == "true" ? graduatedDate.value : null,