Fix Infinite Load Data
Forum & User Search – User - app/(application)/(user)/forum/index.tsx - app/(application)/(user)/user-search/index.tsx Global & Core - app/+not-found.tsx - screens/RootLayout/AppRoot.tsx - constants/constans-value.ts Component - components/Image/AvatarComp.tsx API Client - service/api-client/api-user.ts Untracked Files - QWEN.md - helpers/ - hooks/use-pagination.tsx - screens/Forum/ViewBeranda3.tsx - screens/UserSeach/ ### No Issue
This commit is contained in:
@@ -5,12 +5,27 @@ export async function apiUser(id: string) {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function apiAllUser({ search }: { search: string }) {
|
||||
const response = await apiConfig.get(`/mobile/user?search=${search}`);
|
||||
return response.data;
|
||||
export async function apiAllUser({
|
||||
page,
|
||||
search,
|
||||
}: {
|
||||
page?: string;
|
||||
search?: string;
|
||||
}) {
|
||||
const pageQuery = page ? `?page=${page}` : "";
|
||||
const searchQuery = search ? `&search=${search}` : "";
|
||||
|
||||
try {
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/user${pageQuery}${searchQuery}`,
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiDeleteUser({id}:{id: string}) {
|
||||
export async function apiDeleteUser({ id }: { id: string }) {
|
||||
const response = await apiConfig.delete(`/mobile/user/${id}`);
|
||||
return response.data;
|
||||
}
|
||||
@@ -37,12 +52,19 @@ export async function apiForumBlockUser({
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiAcceptForumTerms({category, userId}:{category:"Forum" | "Event", userId: string}) {
|
||||
export async function apiAcceptForumTerms({
|
||||
category,
|
||||
userId,
|
||||
}: {
|
||||
category: "Forum" | "Event";
|
||||
userId: string;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.post(`/mobile/user/${userId}/terms-of-app?category=${category}`);
|
||||
const response = await apiConfig.post(
|
||||
`/mobile/user/${userId}/terms-of-app?category=${category}`,
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user