Files
hipmi-mobile/service/api-client/api-user.ts
bagasbanuna b6cd308b0b Refactor pagination implementation dan perbaikan UI
- Add default page parameter di apiAllUser
- Refactor MainView_V2.tsx dengan separate render functions
- Update pagination pageSize menjadi 10 di Forum
- Fix iOS height constant dan tab styling
- Rename Admin_ScreenPortofolioCreate ke ScreenPortofolioCreate
- Add TASKS documentation folder

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-25 16:22:54 +08:00

71 lines
1.4 KiB
TypeScript

import { apiConfig } from "../api-config";
export async function apiUser(id: string) {
const response = await apiConfig.get(`/mobile/user/${id}`);
return response.data;
}
export async function apiAllUser({
page = "1",
search,
}: {
page?: string;
search?: string;
}) {
const pageQuery = `?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 }) {
const response = await apiConfig.delete(`/mobile/user/${id}`);
return response.data;
}
export async function apiForumBlockUser({
data,
}: {
data: {
// Id yang di blokir
blockedId: string;
// Id yang melakukan blokir
blockerId: string;
menuFeature: "Event" | "Forum";
};
}) {
console.log("[FETCH API]", data);
try {
const response = await apiConfig.post(`/mobile/block-user`, {
data: data,
});
return response.data;
} catch (error) {
throw error;
}
}
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}`,
);
return response.data;
} catch (error) {
throw error;
}
}