Fix: - app/(application)/(user)/forum/[id]/index.tsx - app/(application)/(user)/home.tsx - screens/Forum/ListPage.tsx - screens/Forum/MenuDrawerSection.tsx/MenuBeranda.tsx - service/api-client/api-master.ts - service/api-client/api-user.ts ### No Issue
39 lines
912 B
TypeScript
39 lines
912 B
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({ search }: { search: string }) {
|
|
const response = await apiConfig.get(`/mobile/user?search=${search}`);
|
|
return response.data;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|