Saya telah melakukan serangkaian perubahan penting dalam pengembangan aplikasi HIPMI Mobile, khususnya dalam modul
Donasi. Berikut adalah ringkasan perubahan yang telah dilakukan:
1. Menerapkan sistem pagination pada berbagai komponen layar donasi:
- ScreenBeranda.tsx
- ScreenMyDonation.tsx
- ScreenRecapOfNews.tsx
- ScreenListOfNews.tsx
- ScreenListOfDonatur.tsx
- ScreenFundDisbursement.tsx
2. Memperbarui fungsi-fungsi API untuk mendukung parameter page:
- apiDonationGetAll
- apiDonationGetNewsById
- apiDonationListOfDonaturById
- apiDonationDisbursementOfFundsListById
3. Mengganti komponen wrapper lama (ViewWrapper) dengan NewWrapper yang mendukung sistem pagination
4. Membuat komponen layar terpisah untuk meningkatkan modularitas kode
5. Memperbaiki berbagai error yang terjadi, termasuk masalah dengan import komponen dan struktur JSX
### No Issue
This commit is contained in:
@@ -109,14 +109,17 @@ export async function apiDonationUpdateData({
|
||||
export async function apiDonationGetAll({
|
||||
category,
|
||||
authorId,
|
||||
page = "1"
|
||||
}: {
|
||||
category: "beranda" | "my-donation";
|
||||
authorId?: string;
|
||||
page?: string;
|
||||
}) {
|
||||
const authorQuery = authorId ? `&authorId=${authorId}` : "";
|
||||
const pageQuery = `&page=${page}`;
|
||||
try {
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/donation?category=${category}${authorQuery}`
|
||||
`/mobile/donation?category=${category}${authorQuery}${pageQuery}`
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
@@ -219,13 +222,15 @@ export async function apiDonationCreateNews({
|
||||
export async function apiDonationGetNewsById({
|
||||
id,
|
||||
category,
|
||||
page = "1"
|
||||
}: {
|
||||
id: string;
|
||||
category: "get-all" | "get-one";
|
||||
page?: string;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/donation/${id}/news?category=${category}`
|
||||
`/mobile/donation/${id}/news?category=${category}&page=${page}`
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
@@ -261,11 +266,28 @@ export async function apiDonationDeleteNews({ id }: { id: string }) {
|
||||
|
||||
export async function apiDonationDisbursementOfFundsListById({
|
||||
id,
|
||||
page = "1"
|
||||
}: {
|
||||
id: string;
|
||||
page?: string;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.get(`/mobile/donation/${id}/disbursement`);
|
||||
const response = await apiConfig.get(`/mobile/donation/${id}/disbursement?page=${page}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiDonationListOfDonaturById({
|
||||
id,
|
||||
page = "1"
|
||||
}: {
|
||||
id: string;
|
||||
page?: string;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.get(`/mobile/donation/${id}/donatur?page=${page}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user