Forum
Fix: - Integrasi API ke semua tampilan ### No Issue
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user