Compare commits

...

3 Commits

Author SHA1 Message Date
3b0ea3d847 chore(release): 1.5.40 2026-02-06 17:38:19 +08:00
097758a431 Fix API mobile Investment
API – Investment (Mobile)
- src/app/api/mobile/investment/route.ts
- src/app/api/mobile/investment/[id]/[status]/route.ts
- src/app/api/mobile/investment/[id]/invoice/route.ts
- src/app/api/mobile/investment/[id]/document/route.ts

Docs
- PROMPT-AI.md

### No issue
2026-02-06 17:37:47 +08:00
6f5849aa29 Fix API mobile
API – Voting (User)
- src/app/api/mobile/voting/route.ts
- src/app/api/mobile/voting/[id]/[status]/route.ts
- src/app/api/mobile/voting/[id]/contribution/route.ts

Docs
- PROMPT-AI.md

### No Issue
2026-02-05 17:35:49 +08:00
10 changed files with 54 additions and 19 deletions

View File

@@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
## [1.5.40](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.39...v1.5.40) (2026-02-06)
## [1.5.39](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.38...v1.5.39) (2026-01-30) ## [1.5.39](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.38...v1.5.39) (2026-01-30)
## [1.5.38](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.37...v1.5.38) (2026-01-27) ## [1.5.38](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.37...v1.5.38) (2026-01-27)

View File

@@ -1,5 +1,5 @@
File utama: src/app/api/mobile/voting/[id]/[status]/route.ts File utama: src/app/api/mobile/investment/[id]/invoice/route.ts
Terapkan pagination pada file "File utama" pada method GET Terapkan pagination pada file "File utama" pada method GET
Analisa juga file "File utama", jika belum memiliki page dari seachParams maka terapkan. Juga pastikan take dan skip sudah sesuai dengan pagination. Buat default nya menjadi 10 untuk take data Analisa juga file "File utama", jika belum memiliki page dari seachParams maka terapkan. Juga pastikan take dan skip sudah sesuai dengan pagination. Buat default nya menjadi 10 untuk take data

View File

@@ -1,6 +1,6 @@
{ {
"name": "hipmi", "name": "hipmi",
"version": "1.5.39", "version": "1.5.40",
"private": true, "private": true,
"prisma": { "prisma": {
"seed": "bun prisma/seed.ts" "seed": "bun prisma/seed.ts"

View File

@@ -1,6 +1,7 @@
import _ from "lodash"; import _ from "lodash";
import { NextResponse } from "next/server"; import { NextResponse } from "next/server";
import prisma from "@/lib/prisma"; import prisma from "@/lib/prisma";
import { PAGINATION_DEFAULT_TAKE } from "@/lib/constans-value/constansValue";
export { GET, PUT }; export { GET, PUT };
@@ -9,6 +10,10 @@ async function GET(
{ params }: { params: { id: string; status: string } } { params }: { params: { id: string; status: string } }
) { ) {
const { id, status } = params; const { id, status } = params;
const { searchParams } = new URL(request.url);
const page = Number(searchParams.get("page"));
const takeData = PAGINATION_DEFAULT_TAKE;
const skipData = page ? page * takeData - takeData : 0;
const fixStatusName = _.startCase(status); const fixStatusName = _.startCase(status);
try { try {
@@ -22,6 +27,8 @@ async function GET(
name: fixStatusName, name: fixStatusName,
}, },
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
select: { select: {
id: true, id: true,
title: true, title: true,

View File

@@ -6,6 +6,7 @@ import {
NotificationMobileTitleType, NotificationMobileTitleType,
} from "../../../../../../../types/type-mobile-notification"; } from "../../../../../../../types/type-mobile-notification";
import { routeAdminMobile, routeUserMobile } from "@/lib/mobile/route-page-mobile"; import { routeAdminMobile, routeUserMobile } from "@/lib/mobile/route-page-mobile";
import { PAGINATION_DEFAULT_TAKE } from "@/lib/constans-value/constansValue";
export { POST, GET, DELETE }; export { POST, GET, DELETE };
@@ -98,6 +99,9 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
const { id } = params; const { id } = params;
const { searchParams } = new URL(request.url); const { searchParams } = new URL(request.url);
const category = searchParams.get("category"); const category = searchParams.get("category");
const page = Number(searchParams.get("page"));
const takeData = PAGINATION_DEFAULT_TAKE
const skipData = page * takeData - takeData
try { try {
let fixData; let fixData;
@@ -117,6 +121,8 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
investasiId: id, investasiId: id,
active: true, active: true,
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
}); });
} }

View File

@@ -7,6 +7,7 @@ import {
NotificationMobileTitleType, NotificationMobileTitleType,
NotificationMobileBodyType, NotificationMobileBodyType,
} from "../../../../../../../types/type-mobile-notification"; } from "../../../../../../../types/type-mobile-notification";
import { PAGINATION_DEFAULT_TAKE } from "@/lib/constans-value/constansValue";
export { POST, GET, PUT }; export { POST, GET, PUT };
@@ -53,6 +54,9 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
const { searchParams } = new URL(request.url); const { searchParams } = new URL(request.url);
const category = searchParams.get("category"); const category = searchParams.get("category");
const authorId = searchParams.get("authorId"); const authorId = searchParams.get("authorId");
const page = Number(searchParams.get("page"));
const takeData = PAGINATION_DEFAULT_TAKE;
const skipData = page ? page * takeData - takeData : 0;
console.log("[ID INVOICE]", id); console.log("[ID INVOICE]", id);
@@ -103,6 +107,8 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
statusInvoiceId: "1", statusInvoiceId: "1",
isActive: true, isActive: true,
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
select: { select: {
id: true, id: true,
nominal: true, nominal: true,
@@ -129,6 +135,8 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
where: { where: {
authorId: authorId, authorId: authorId,
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
select: { select: {
id: true, id: true,
statusInvoiceId: true, statusInvoiceId: true,

View File

@@ -5,6 +5,7 @@ import moment from "moment";
import { sendNotificationMobileToManyUser } from "@/lib/mobile/notification/send-notification"; import { sendNotificationMobileToManyUser } from "@/lib/mobile/notification/send-notification";
import { NotificationMobileBodyType } from "../../../../../types/type-mobile-notification"; import { NotificationMobileBodyType } from "../../../../../types/type-mobile-notification";
import { routeAdminMobile } from "@/lib/mobile/route-page-mobile"; import { routeAdminMobile } from "@/lib/mobile/route-page-mobile";
import { PAGINATION_DEFAULT_TAKE } from "@/lib/constans-value/constansValue";
export { POST, GET }; export { POST, GET };
@@ -73,6 +74,9 @@ async function GET(request: Request) {
const { searchParams } = new URL(request.url); const { searchParams } = new URL(request.url);
const category = searchParams.get("category"); const category = searchParams.get("category");
const authorId = searchParams.get("authorId"); const authorId = searchParams.get("authorId");
const page = Number(searchParams.get("page"));
const takeData = PAGINATION_DEFAULT_TAKE
const skipData = page ? page * takeData - takeData : 0;
console.log("[CATEGORY]", category); console.log("[CATEGORY]", category);
console.log("[AUTHOR ID]", authorId); console.log("[AUTHOR ID]", authorId);
@@ -132,6 +136,8 @@ async function GET(request: Request) {
where: { where: {
masterStatusInvestasiId: "1", masterStatusInvestasiId: "1",
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
select: { select: {
id: true, id: true,
imageId: true, imageId: true,
@@ -156,6 +162,8 @@ async function GET(request: Request) {
authorId: authorId, authorId: authorId,
statusInvoiceId: "1", statusInvoiceId: "1",
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
select: { select: {
id: true, id: true,
investasiId: true, investasiId: true,

View File

@@ -1,6 +1,7 @@
import _ from "lodash"; import _ from "lodash";
import { NextResponse } from "next/server"; import { NextResponse } from "next/server";
import prisma from "@/lib/prisma"; import prisma from "@/lib/prisma";
import { PAGINATION_DEFAULT_TAKE } from "@/lib/constans-value/constansValue";
export { GET, PUT }; export { GET, PUT };
@@ -10,13 +11,11 @@ async function GET(
) { ) {
try { try {
const { id, status } = params; const { id, status } = params;
console.log("[ID]", id);
const fixStatusName = _.startCase(status); const fixStatusName = _.startCase(status);
console.log("[STATUS]", fixStatusName);
const { searchParams } = new URL(request.url); const { searchParams } = new URL(request.url);
const page = Number(searchParams.get("page")) || 1; const page = Number(searchParams.get("page")) || 1;
const takeData = 10; const takeData = PAGINATION_DEFAULT_TAKE
const skipData = page * takeData - takeData; const skipData = page * takeData - takeData;
let data; let data;
@@ -101,9 +100,7 @@ async function PUT(
) { ) {
try { try {
const { id, status } = params; const { id, status } = params;
console.log("[ID]", id);
const fixStatusName = _.startCase(status); const fixStatusName = _.startCase(status);
console.log("[STATUS]", fixStatusName);
const checkData = await prisma.voting.findFirst({ const checkData = await prisma.voting.findFirst({
where: { where: {
@@ -119,8 +116,6 @@ async function PUT(
}, },
}); });
console.log("[CHECKDATA]", checkData);
if (!checkData) if (!checkData)
return NextResponse.json({ return NextResponse.json({
success: false, success: false,
@@ -155,8 +150,6 @@ async function PUT(
}, },
}); });
console.log("[UPDATE]", updateData);
return NextResponse.json({ return NextResponse.json({
success: true, success: true,
message: "Success update voting", message: "Success update voting",

View File

@@ -1,5 +1,6 @@
import { NextResponse } from "next/server"; import { NextResponse } from "next/server";
import prisma from "@/lib/prisma"; import prisma from "@/lib/prisma";
import { PAGINATION_DEFAULT_TAKE } from "@/lib/constans-value/constansValue";
export { GET }; export { GET };
@@ -8,10 +9,9 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
const { searchParams } = new URL(request.url); const { searchParams } = new URL(request.url);
const authorId = searchParams.get("authorId"); const authorId = searchParams.get("authorId");
const category = searchParams.get("category"); const category = searchParams.get("category");
const page = Number(searchParams.get("page"));
console.log("[ID]", id); const takeData = PAGINATION_DEFAULT_TAKE;
console.log("[AUTHOR ID]", authorId); const skipData = page ? page * takeData - takeData : 0;
console.log("[CATEGORY]", category);
let fixData; let fixData;
@@ -53,7 +53,10 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
where: { where: {
votingId: id, votingId: id,
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
select: { select: {
id: true,
Voting_DaftarNamaVote: { Voting_DaftarNamaVote: {
select: { select: {
value: true, value: true,
@@ -75,8 +78,6 @@ async function GET(request: Request, { params }: { params: { id: string } }) {
}, },
}); });
console.log("[LIST KONTRIBUTOR]", listKontributor);
fixData = listKontributor; fixData = listKontributor;
} }

View File

@@ -4,6 +4,7 @@ import _ from "lodash";
import { sendNotificationMobileToManyUser } from "@/lib/mobile/notification/send-notification"; import { sendNotificationMobileToManyUser } from "@/lib/mobile/notification/send-notification";
import { NotificationMobileBodyType } from "../../../../../types/type-mobile-notification"; import { NotificationMobileBodyType } from "../../../../../types/type-mobile-notification";
import { routeAdminMobile } from "@/lib/mobile/route-page-mobile"; import { routeAdminMobile } from "@/lib/mobile/route-page-mobile";
import { PAGINATION_DEFAULT_TAKE } from "@/lib/constans-value/constansValue";
export { POST, GET }; export { POST, GET };
@@ -87,8 +88,9 @@ async function GET(request: Request) {
const category = searchParams.get("category"); const category = searchParams.get("category");
const authorId = searchParams.get("authorId"); const authorId = searchParams.get("authorId");
const userLoginId = searchParams.get("userLoginId"); const userLoginId = searchParams.get("userLoginId");
const page = Number(searchParams.get("page"));
console.log("userLoginId >>", userLoginId); const takeData = PAGINATION_DEFAULT_TAKE;
const skipData = page * takeData - takeData;
let fixData; let fixData;
@@ -123,6 +125,8 @@ async function GET(request: Request) {
}, },
}, },
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
include: { include: {
Voting_DaftarNamaVote: { Voting_DaftarNamaVote: {
orderBy: { orderBy: {
@@ -154,6 +158,8 @@ async function GET(request: Request) {
where: { where: {
authorId: authorId, authorId: authorId,
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
include: { include: {
Voting: { Voting: {
select: { select: {
@@ -211,6 +217,8 @@ async function GET(request: Request) {
mode: "insensitive", mode: "insensitive",
}, },
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
include: { include: {
Voting_DaftarNamaVote: { Voting_DaftarNamaVote: {
orderBy: { orderBy: {
@@ -249,6 +257,8 @@ async function GET(request: Request) {
mode: "insensitive", mode: "insensitive",
}, },
}, },
take: page ? takeData : undefined,
skip: page ? skipData : undefined,
include: { include: {
Voting_DaftarNamaVote: { Voting_DaftarNamaVote: {
orderBy: { orderBy: {