fix:API
This commit is contained in:
parent
6aa8a61b40
commit
99cba9f3bd
5 changed files with 37 additions and 9 deletions
|
|
@ -20,6 +20,8 @@ const { showLoader, hideLoader, messageError, success } = useCounterMixin();
|
|||
//props
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
||||
const profileId = ref<string>(route.params.id?.toString() ?? ""); //ProfileId
|
||||
|
||||
const form = reactive({
|
||||
tranferOrg: "",
|
||||
noteReason: "",
|
||||
|
|
@ -30,14 +32,16 @@ async function onSubmit() {
|
|||
try {
|
||||
showLoader();
|
||||
const formData = new FormData();
|
||||
formData.append("ProfileId", profileId.value);
|
||||
formData.append("Organization", form.tranferOrg);
|
||||
formData.append("Reason", form.noteReason);
|
||||
if (form.files) {
|
||||
formData.append("file", form.files);
|
||||
}
|
||||
|
||||
// await http.post(config.API.listtransfer(), formData);
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
await http.post(config.API.transferAdmin, formData);
|
||||
router.push({ name: "transfer" });
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
} catch (error) {
|
||||
messageError($q, error);
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue