Add: - api-client/api-forum Fix: - Integrasi API: create dan beranda file ### No Issue
22 lines
493 B
TypeScript
22 lines
493 B
TypeScript
import { apiConfig } from "../api-config";
|
|
|
|
export async function apiForumCreate({ data }: { data: any }) {
|
|
try {
|
|
const response = await apiConfig.post(`/mobile/forum`, {
|
|
data: data,
|
|
});
|
|
return response.data;
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
export async function apiForumGetAll({search}: {search: string}) {
|
|
try {
|
|
const response = await apiConfig.get(`/mobile/forum?search=${search}`);
|
|
return response.data;
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
}
|