Donation:
Add: - service/api-client/api-donation.ts Fix: - service/api-client/api-master.ts : tambah master donasi - app/(application)/(user)/donation/create.tsx - app/(application)/(user)/donation/create-story.tsx ### No issue
This commit is contained in:
22
service/api-client/api-donation.ts
Normal file
22
service/api-client/api-donation.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { apiConfig } from "../api-config";
|
||||
|
||||
export async function apiDonationCreate({ data , category}: { data: any , category: "temporary" | "permanent"}) {
|
||||
try {
|
||||
const response = await apiConfig.post(`/mobile/donation?category=${category}`, {
|
||||
data: data,
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiDonationGetOne({ id, category }: { id: string , category: "temporary" | "permanent"}) {
|
||||
try {
|
||||
const response = await apiConfig.get(`/mobile/donation/${id}?category=${category}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user