Fix:
- Integrasi API ke semua tampilan

### No Issue
This commit is contained in:
2025-09-26 17:43:50 +08:00
parent 18beb09b42
commit 29b65aeebf
9 changed files with 441 additions and 116 deletions

View File

@@ -11,9 +11,19 @@ export async function apiForumCreate({ data }: { data: any }) {
}
}
export async function apiForumGetAll({ search }: { search: string }) {
export async function apiForumGetAll({
search,
authorId,
}: {
search: string;
authorId?: string;
}) {
const authorQuery = authorId ? `?authorId=${authorId}` : "";
const searchQuery = search ? `?search=${search}` : "";
const query = search ? searchQuery : authorQuery;
try {
const response = await apiConfig.get(`/mobile/forum?search=${search}`);
const response = await apiConfig.get(`/mobile/forum${query}`);
return response.data;
} catch (error) {
throw error;
@@ -40,7 +50,13 @@ export async function apiForumUpdate({ id, data }: { id: string; data: any }) {
}
}
export async function apiForumUpdateStatus({ id, data }: { id: string; data: any }) {
export async function apiForumUpdateStatus({
id,
data,
}: {
id: string;
data: any;
}) {
try {
const response = await apiConfig.post(`/mobile/forum/${id}`, {
data: data,

View File

@@ -32,9 +32,55 @@ export async function apiMasterEventType() {
export async function apiMasterCollaborationType() {
try {
const response = await apiConfig.get(`/mobile/master/collaboration-industry`);
const response = await apiConfig.get(
`/mobile/master/collaboration-industry`
);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiMasterForumReportList() {
try {
const response = await apiConfig.get(`/mobile/master/forum-report`);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiForumCreateReportPosting({
id,
data,
}: {
id: string;
data: any;
}) {
try {
const response = await apiConfig.post(`/mobile/forum/${id}/report-posting`, {
data: data,
});
return response.data;
} catch (error) {
throw error;
}
}
export async function apiForumCreateReportCommentar({
id,
data,
}: {
id: string;
data: any;
}) {
try {
const response = await apiConfig.post(`/mobile/forum/${id}/report-commentar`, {
data: data,
});
return response.data;
} catch (error) {
throw error;
}
}