position
Deskripsi: - edit position - delete position No Issues
This commit is contained in:
29
lib/api.ts
29
lib/api.ts
@@ -96,17 +96,20 @@ export const apiCreatePosition = async (data: { user: string, name: string, idGr
|
||||
};
|
||||
|
||||
|
||||
// export const updateEntityById = async (id: any, updatedEntity: any) => {
|
||||
// const response = await api.put(`/entities/${id}`, updatedEntity);
|
||||
// return response.data;
|
||||
// };
|
||||
export const apiDeletePosition = async (data: { user: string, isActive: boolean }, id: string) => {
|
||||
await api.delete(`mobile/position/${id}`, { data }).then(response => {
|
||||
return response.data;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
};
|
||||
|
||||
// export const deleteEntityById = async (id: any) => {
|
||||
// const response = await api.delete(`/entities/${id}`);
|
||||
// return response.data;
|
||||
// };
|
||||
|
||||
// export const checkAccount = async (newEntity: { phone: string }) => {
|
||||
// const response = await api.post('/auth/login', newEntity);
|
||||
// return response.data;
|
||||
// };
|
||||
export const apiEditPosition = async (data: { user: string, name: string, idGroup: string }, id: string) => {
|
||||
await api.put(`mobile/position/${id}`, data).then(response => {
|
||||
return response.data;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user