Poortofoloio

Fix:
- service/api-client/api-portofolio.ts : api edit detail. logo, medsos

### No Issue
This commit is contained in:
2025-09-01 17:10:25 +08:00
parent bb95e8ccbd
commit 6887f85e6a
7 changed files with 381 additions and 67 deletions

View File

@@ -25,7 +25,7 @@ export async function apiGetPortofolio({ id }: { id: string }) {
export async function apiGetOnePortofolio({ id }: { id: string }) {
try {
const response = await apiConfig.get(`/mobile/portofolio/${id}`);
return response.data;
} catch (error) {
throw error;
@@ -35,10 +35,32 @@ export async function apiGetOnePortofolio({ id }: { id: string }) {
export async function apiDeletePortofolio({ id }: { id: string }) {
try {
const response = await apiConfig.delete(`/mobile/portofolio/${id}`);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiUpdatePortofolio({
id,
data,
category,
}: {
id: string;
data: any;
category: "detail" | "medsos" | "logo";
}) {
try {
const response = await apiConfig.put(
`/mobile/portofolio/${id}?category=${category}`,
{
data: data,
}
);
return response.data;
} catch (error) {
throw error;
}
}