Fix Load data pada halaman yang membutuhkan infinite load
Job – User App - app/(application)/(user)/job/(tabs)/index.tsx - app/(application)/(user)/job/(tabs)/status.tsx - app/(application)/(user)/job/(tabs)/archive.tsx - app/(application)/(user)/job/create.tsx Job – Screens - screens/Job/ScreenBeranda.tsx - screens/Job/ScreenBeranda2.tsx - screens/Job/MainViewStatus.tsx - screens/Job/MainViewStatus2.tsx - screens/Job/ScreenArchive.tsx - screens/Job/ScreenArchive2.tsx API – Job (Client) - service/api-client/api-job.ts Notification - screens/Notification/ScreenNotification.tsx Docs - QWEN.md - docs/prompt-for-qwen-code.md ### No Issue
This commit is contained in:
@@ -14,12 +14,14 @@ export async function apiJobCreate(data: any) {
|
||||
export async function apiJobGetByStatus({
|
||||
authorId,
|
||||
status,
|
||||
page = "1",
|
||||
}: {
|
||||
authorId: string;
|
||||
status: string;
|
||||
page?: string;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.get(`/mobile/job/${authorId}/${status}`);
|
||||
const response = await apiConfig.get(`/mobile/job/${authorId}/${status}?page=${page}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
@@ -63,10 +65,12 @@ export async function apiJobGetAll({
|
||||
search,
|
||||
category,
|
||||
authorId,
|
||||
page = "1",
|
||||
}: {
|
||||
search?: string;
|
||||
category: "archive" | "beranda";
|
||||
authorId?: string;
|
||||
page?: string;
|
||||
}) {
|
||||
try {
|
||||
let categoryText = category ? `?category=${category}` : "";
|
||||
@@ -74,8 +78,9 @@ export async function apiJobGetAll({
|
||||
categoryText = `?category=${category}&authorId=${authorId}`;
|
||||
}
|
||||
const searchText = search ? `&search=${search}` : "";
|
||||
const pageText = `&page=${page}`;
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/job${categoryText}${searchText}`
|
||||
`/mobile/job${categoryText}${searchText}${pageText}`
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user