fix: payload profileEmployeeId
This commit is contained in:
parent
ecc10e16c9
commit
0a5f64c17c
1 changed files with 10 additions and 3 deletions
|
|
@ -57,16 +57,23 @@ function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
try {
|
try {
|
||||||
showLoader();
|
showLoader();
|
||||||
const playload = {
|
const payload = {
|
||||||
...form,
|
...form,
|
||||||
stampDate: convertDateToAPI(form.stampDate),
|
stampDate: convertDateToAPI(form.stampDate),
|
||||||
profileId: isStatusEdit.value ? undefined : profileId.value,
|
profileId:
|
||||||
|
!isStatusEdit.value && empType.value === ""
|
||||||
|
? profileId.value
|
||||||
|
: undefined,
|
||||||
|
profileEmployeeId:
|
||||||
|
!isStatusEdit.value && empType.value !== ""
|
||||||
|
? profileId.value
|
||||||
|
: undefined,
|
||||||
};
|
};
|
||||||
const method = isStatusEdit.value ? "patch" : "post";
|
const method = isStatusEdit.value ? "patch" : "post";
|
||||||
const url = isStatusEdit.value
|
const url = isStatusEdit.value
|
||||||
? config.API.profileAbsentLate(empType.value) + `/${rowId.value}`
|
? config.API.profileAbsentLate(empType.value) + `/${rowId.value}`
|
||||||
: config.API.profileAbsentLate(empType.value);
|
: config.API.profileAbsentLate(empType.value);
|
||||||
await http[method](url, playload);
|
await http[method](url, payload);
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
props.fetchData();
|
props.fetchData();
|
||||||
closeDialog();
|
closeDialog();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue