Invesment

Fix:
- tampilan dokumen dan file prospektus
- create & edit dokumen
- list rekap dokumen dan tampilan ( untuk non author )

### No Issue
This commit is contained in:
2025-10-01 14:40:50 +08:00
parent 5f05d1f7f0
commit 250b216a54
7 changed files with 403 additions and 90 deletions

View File

@@ -44,7 +44,6 @@ export async function apiInvestmentUpdateStatus({
id: string;
status: "publish" | "draft" | "review" | "reject";
}) {
try {
const response = await apiConfig.put(`/mobile/investment/${id}/${status}`);
return response.data;
@@ -71,9 +70,28 @@ export async function apiInvestmentUpdateData({
data: any;
category: "data" | "prospectus";
}) {
try {
const response = await apiConfig.put(`/mobile/investment/${id}?category=${category}`, {
const response = await apiConfig.put(
`/mobile/investment/${id}?category=${category}`,
{
data: data,
}
);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiInvestmentUpsertDocument({
id,
data,
}: {
id: string;
data: any;
}) {
try {
const response = await apiConfig.post(`/mobile/investment/${id}/document`, {
data: data,
});
return response.data;
@@ -81,3 +99,35 @@ export async function apiInvestmentUpdateData({
throw error;
}
}
export async function apiInvestmentGetDocument({
id,
category,
}: {
id: string;
category: "one-document" | "all-document";
}) {
try {
const response = await apiConfig.get(
`/mobile/investment/${id}/document?category=${category}`
);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiInvestmentDeleteDocument({
id,
}: {
id: string;
}) {
try {
const response = await apiConfig.delete(
`/mobile/investment/${id}/document`
);
return response.data;
} catch (error) {
throw error;
}
}