Merge pull request 'join' (#35) from join into staging

Reviewed-on: bip/sistem-desa-mandiri#35
This commit is contained in:
2025-08-29 17:06:23 +08:00
5 changed files with 6 additions and 6 deletions

View File

@@ -60,9 +60,9 @@ export async function POST(request: Request) {
for (var pair of body.entries()) {
if (String(pair[0]).substring(0, 4) == "file") {
const file = body.get(pair[0]) as File
const fileName = file.name
const fileName = decodeURIComponent(file.name)
const fExt = file.name.split(".").pop()
let fName = file.name.replace("." + fExt, "")
let fName = fileName.replace("." + fExt, "")
const cek = dataOmit.some((i: any) => i.file == fileName)
if (cek) {
const random = Math.floor(Math.random() * 1000)

View File

@@ -77,7 +77,7 @@ export async function PUT(request: Request, context: { params: { id: string } })
}
const file = body.get("file") as File
const fileName = file.name
const fileName = decodeURIComponent(file.name)
const dataCek = await prisma.project.count({
where: {

View File

@@ -227,7 +227,7 @@ export async function POST(request: Request) {
if (String(pair[0]).substring(0, 4) == "file") {
const file = body.get(pair[0]) as File
const fExt = file.name.split(".").pop()
const fName = file.name.replace("." + fExt, "")
const fName = decodeURIComponent(file.name.replace("." + fExt, ""))
const upload = await funUploadFile({ file: file, dirId: DIR.project })
if (upload.success) {
await prisma.projectFile.create({

View File

@@ -173,7 +173,7 @@ export async function PUT(request: Request, context: { params: { id: string } })
}
const file = body.get("file") as File
const fileName = file.name
const fileName = decodeURIComponent(file.name)
const dataCek = await prisma.divisionProject.count({
where: {

View File

@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
export async function GET(request: Request) {
try {
return NextResponse.json({ success: true, version: "1.7.7", tahap: "beta", update: "-api mobile; -tambah laporan pada project dan tugas divisi; -tambah upload link pada project dan tugas divisi; -tambah detail tanggal dan jam pada project dan tugas divisi" }, { status: 200 });
return NextResponse.json({ success: true, version: "1.7.8", tahap: "beta", update: "-api mobile; -tambah laporan pada project dan tugas divisi; -tambah upload link pada project dan tugas divisi; -tambah detail tanggal dan jam pada project dan tugas divisi" }, { status: 200 });
} catch (error) {
console.error(error);
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });