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 () => {
|
||||
try {
|
||||
showLoader();
|
||||
const playload = {
|
||||
const payload = {
|
||||
...form,
|
||||
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 url = isStatusEdit.value
|
||||
? config.API.profileAbsentLate(empType.value) + `/${rowId.value}`
|
||||
: config.API.profileAbsentLate(empType.value);
|
||||
await http[method](url, playload);
|
||||
await http[method](url, payload);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
props.fetchData();
|
||||
closeDialog();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue