Integrasi API: Investment & Admin Investment

Add:
- components/_ShareComponent/NoDataText.tsx
- service/api-admin/api-admin-investment.ts

Fix:
- app/(application)/(user)/investment/(tabs)/index.tsx
- app/(application)/admin/investment/[id]/[status]/index.tsx
- app/(application)/admin/investment/[id]/reject-input.tsx
- app/(application)/admin/investment/[status]/status.tsx
- app/(application)/admin/investment/index.tsx
- screens/Invesment/DetailDataPublishSection.tsx

### No Issue
This commit is contained in:
2025-10-30 15:13:33 +08:00
parent b3209dc7ee
commit f23cfe1107
8 changed files with 413 additions and 119 deletions

View File

@@ -0,0 +1,54 @@
import { apiConfig } from "../api-config";
export async function apiAdminInvestment({
category,
search,
}: {
category: "dashboard" | "publish" | "review" | "reject";
search?: string;
}) {
const propsQuery =
category === "dashboard"
? `category=${category}`
: `category=${category}&search=${search}`;
try {
const response = await apiConfig.get(
`/mobile/admin/investment?${propsQuery}`
);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiAdminInvestmentDetailById({ id }: { id: string }) {
try {
const response = await apiConfig.get(`/mobile/admin/investment/${id}`);
return response.data;
} catch (error) {
throw error;
}
}
export async function apiAdminInvestasiUpdateByStatus({
id,
status,
data,
}: {
id: string;
status: "publish" | "review" | "reject";
data: any;
}) {
try {
const response = await apiConfig.put(
`/mobile/admin/investment/${id}?status=${status}`,
{
data: data,
}
);
return response.data;
} catch (error) {
throw error;
}
}