Add api
This commit is contained in:
45
src/api/master-apd.jsx
Normal file
45
src/api/master-apd.jsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import { SendRequest } from '../components/Global/ApiRequest';
|
||||
|
||||
const getAllApd = async (queryParams) => {
|
||||
const response = await SendRequest({
|
||||
method: 'get',
|
||||
prefix: `apd?${queryParams.toString()}`,
|
||||
});
|
||||
return response;
|
||||
};
|
||||
|
||||
const createApd = async (queryParams) => {
|
||||
const response = await SendRequest({
|
||||
method: 'post',
|
||||
prefix: `apd`,
|
||||
params: queryParams,
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const updateApd = async (vendor_id, queryParams) => {
|
||||
const response = await SendRequest({
|
||||
method: 'put',
|
||||
prefix: `apd/${vendor_id}`,
|
||||
params: queryParams,
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const deleteApd = async (queryParams) => {
|
||||
const response = await SendRequest({
|
||||
method: 'delete',
|
||||
prefix: `apd/${queryParams}`,
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getJenisPermit = async () => {
|
||||
const response = await SendRequest({
|
||||
method: 'get',
|
||||
prefix: `apd/jenis-permit`,
|
||||
});
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export { getAllApd, createApd, updateApd, deleteApd, getJenisPermit };
|
||||
Reference in New Issue
Block a user