Integrasi API Donation
Fix: - (application)/(user)/donation/[id]/(news)/[news]/edit-news - (application)/(user)/donation/[id]/(news)/[news]/index - (application)/(user)/donation/[id]/(news)/add-news - (application)/(user)/donation/[id]/(news)/list-of-news - (application)/(user)/donation/[id]/(news)/recap-of-news - (application)/(user)/donation/[id]/infromation-fundrising - service/api-client/api-donation ### No Issue
This commit is contained in:
@@ -213,11 +213,45 @@ export async function apiDonationCreateNews({
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiDonationGetNewsById({ id , category}: { id: string , category: "get-all" | "get-one"}) {
|
||||
export async function apiDonationGetNewsById({
|
||||
id,
|
||||
category,
|
||||
}: {
|
||||
id: string;
|
||||
category: "get-all" | "get-one";
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.get(`/mobile/donation/${id}/news?category=${category}`);
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/donation/${id}/news?category=${category}`
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiDonationUpdateNews({
|
||||
id,
|
||||
data,
|
||||
}: {
|
||||
id: string;
|
||||
data: any;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.put(`/mobile/donation/${id}/news`, {
|
||||
data: data,
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiDonationDeleteNews({ id }: { id: string }) {
|
||||
try {
|
||||
const response = await apiConfig.delete(`/mobile/donation/${id}/news`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user