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:
54
service/api-admin/api-admin-investment.ts
Normal file
54
service/api-admin/api-admin-investment.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user