Fix Loaddata Voting
UI – Voting (User) - app/(application)/(user)/voting/(tabs)/index.tsx - app/(application)/(user)/voting/(tabs)/history.tsx - app/(application)/(user)/voting/(tabs)/contribution.tsx - app/(application)/(user)/voting/create.tsx - app/(application)/(user)/voting/[id]/edit.tsx - app/(application)/(user)/voting/[id]/[status]/detail.tsx - app/(application)/(user)/voting/[id]/list-of-contributor.tsx UI – Event - app/(application)/(user)/event/[id]/edit.tsx - screens/Event/ScreenStatus.tsx UI – Voting Screens (New) - screens/Voting/ScreenBeranda.tsx - screens/Voting/ScreenContribution.tsx - screens/Voting/ScreenHistory.tsx - screens/Voting/ScreenListOfContributor.tsx - screens/Voting/ScreenStatus.tsx - screens/Voting/ButtonStatusSection.tsx UI – Job - screens/Job/ButtonStatusSection.tsx - screens/Job/MainViewStatus2.tsx API Client - service/api-client/api-voting.ts Docs - docs/prompt-for-qwen-code.md ### No Issue
This commit is contained in:
@@ -81,14 +81,15 @@ export async function apiVotingUpdateData({
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiVotingGetAll({ search, category, authorId, userLoginId }: { search?: string, category: "beranda" | "contribution" | "all-history" | "my-history", authorId?: string, userLoginId?: string }) {
|
||||
export async function apiVotingGetAll({ search, category, authorId, userLoginId, page = "1" }: { search?: string, category: "beranda" | "contribution" | "all-history" | "my-history", authorId?: string, userLoginId?: string, page?: string }) {
|
||||
try {
|
||||
console.log("userLoginId", userLoginId);
|
||||
const categoryQuery = category ? `?category=${category}` : "";
|
||||
const searchQuery = search ? `&search=${search}` : "";
|
||||
const authorIdQuery = authorId ? `&authorId=${authorId}` : "";
|
||||
const userLoginIdQuery = userLoginId ? `&userLoginId=${userLoginId}` : "";
|
||||
const response = await apiConfig.get(`/mobile/voting${categoryQuery}${searchQuery}${authorIdQuery}${userLoginIdQuery}`);
|
||||
const pageQuery = `&page=${page}`;
|
||||
const response = await apiConfig.get(`/mobile/voting${categoryQuery}${searchQuery}${authorIdQuery}${userLoginIdQuery}${pageQuery}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
@@ -110,15 +111,17 @@ export async function apiVotingContribution({
|
||||
id,
|
||||
authorId,
|
||||
category,
|
||||
page = "1",
|
||||
}: {
|
||||
id: string;
|
||||
authorId: string;
|
||||
category: "list" | "checked";
|
||||
page?: string;
|
||||
}) {
|
||||
const query =
|
||||
category === "list"
|
||||
? "?category=list"
|
||||
: `?category=checked&authorId=${authorId}`;
|
||||
? `?category=list&page=${page}`
|
||||
: `?category=checked&authorId=${authorId}&page=${page}`;
|
||||
try {
|
||||
const response = await apiConfig.get(
|
||||
`/mobile/voting/${id}/contribution${query}`
|
||||
|
||||
Reference in New Issue
Block a user