refactor: api divisi

Deskripsi:
- folder manager api divisi

No Issues
This commit is contained in:
amel
2024-08-13 10:42:59 +08:00
parent 15b20f825c
commit c3a92f7898
13 changed files with 3 additions and 375 deletions

View File

@@ -30,7 +30,7 @@ export default function DrawerListPosition({ onCreated }: { onCreated: (val: boo
}
} catch (error) {
console.error(error)
toast.error("Gagal mendapatkan grup, coba lagi nanti");
toast.error("Gagal mendapatkan jabatan, coba lagi nanti");
}
}
@@ -41,29 +41,6 @@ export default function DrawerListPosition({ onCreated }: { onCreated: (val: boo
async function onSubmit() {
try {
// const res = await fetch(API_ADDRESS.apiCreatePosition, {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json'
// },
// body: JSON.stringify({
// name: listData.name,
// idGroup: listData.idGroup
// })
// })
// if (!res.ok) {
// const errorData = await res.json();
// if (errorData.message === "Position sudah ada") {
// toast.error('Gagal! Position sudah ada');
// } else {
// toast.error('Error');
// }
// } else {
// setOpenDrawerGroup(false)
// toast.success('Sukses! data tersimpan')
// }
// onCreated(true)
const res = await funCreatePosition({
name: listData.name,
idGroup: listData.idGroup
@@ -76,7 +53,7 @@ export default function DrawerListPosition({ onCreated }: { onCreated: (val: boo
} else {
toast.error(res.message)
}
} catch (error) {
toast.error('Error')
}