Collaboration
Add: - (user)/collaboration/[id]/select-of-participants Fix: - Integrasi ke api di bagian beranda , partisipan dan group ### No Issue
This commit is contained in:
@@ -11,9 +11,18 @@ export async function apiCollaborationCreate({ data }: { data: any }) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiCollaborationGetAll() {
|
||||
export async function apiCollaborationGetAll({
|
||||
category,
|
||||
authorId,
|
||||
}: {
|
||||
category: "beranda" | "participant" | "my-project" | "group";
|
||||
authorId?: string;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.get(`/mobile/collaboration`);
|
||||
const authorQuery = authorId ? `&authorId=${authorId}` : "";
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/collaboration?category=${category}${authorQuery}`
|
||||
);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
@@ -32,7 +41,6 @@ export async function apiCollaborationGetOne({ id }: { id: string }) {
|
||||
export async function apiCollaborationCreatePartisipasi({
|
||||
id,
|
||||
data,
|
||||
|
||||
}: {
|
||||
id: string;
|
||||
data: any;
|
||||
@@ -69,3 +77,40 @@ export async function apiCollaborationGetParticipants({
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiCollaborationCreateGroup({
|
||||
id,
|
||||
data,
|
||||
}: {
|
||||
id: string;
|
||||
data: any;
|
||||
}) {
|
||||
try {
|
||||
const response = await apiConfig.post(`/mobile/collaboration/${id}`, {
|
||||
data: data,
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiCollaborationEditData({ id, data }: { id: string; data: any }) {
|
||||
try {
|
||||
const response = await apiConfig.put(`/mobile/collaboration/${id}`, {
|
||||
data: data,
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiCollaborationGroup({ id }: { id: string }) {
|
||||
try {
|
||||
const response = await apiConfig.get(`/mobile/collaboration/${id}/group`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user