Merge pull request 'amalia/29-agustus-25' (#34) from amalia/29-agustus-25 into join
Reviewed-on: bip/sistem-desa-mandiri#34
This commit is contained in:
@@ -60,9 +60,9 @@ export async function POST(request: Request) {
|
|||||||
for (var pair of body.entries()) {
|
for (var pair of body.entries()) {
|
||||||
if (String(pair[0]).substring(0, 4) == "file") {
|
if (String(pair[0]).substring(0, 4) == "file") {
|
||||||
const file = body.get(pair[0]) as File
|
const file = body.get(pair[0]) as File
|
||||||
const fileName = file.name
|
const fileName = decodeURIComponent(file.name)
|
||||||
const fExt = file.name.split(".").pop()
|
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)
|
const cek = dataOmit.some((i: any) => i.file == fileName)
|
||||||
if (cek) {
|
if (cek) {
|
||||||
const random = Math.floor(Math.random() * 1000)
|
const random = Math.floor(Math.random() * 1000)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export async function PUT(request: Request, context: { params: { id: string } })
|
|||||||
}
|
}
|
||||||
|
|
||||||
const file = body.get("file") as File
|
const file = body.get("file") as File
|
||||||
const fileName = file.name
|
const fileName = decodeURIComponent(file.name)
|
||||||
|
|
||||||
const dataCek = await prisma.project.count({
|
const dataCek = await prisma.project.count({
|
||||||
where: {
|
where: {
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ export async function POST(request: Request) {
|
|||||||
if (String(pair[0]).substring(0, 4) == "file") {
|
if (String(pair[0]).substring(0, 4) == "file") {
|
||||||
const file = body.get(pair[0]) as File
|
const file = body.get(pair[0]) as File
|
||||||
const fExt = file.name.split(".").pop()
|
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 })
|
const upload = await funUploadFile({ file: file, dirId: DIR.project })
|
||||||
if (upload.success) {
|
if (upload.success) {
|
||||||
await prisma.projectFile.create({
|
await prisma.projectFile.create({
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ export async function PUT(request: Request, context: { params: { id: string } })
|
|||||||
}
|
}
|
||||||
|
|
||||||
const file = body.get("file") as File
|
const file = body.get("file") as File
|
||||||
const fileName = file.name
|
const fileName = decodeURIComponent(file.name)
|
||||||
|
|
||||||
const dataCek = await prisma.divisionProject.count({
|
const dataCek = await prisma.divisionProject.count({
|
||||||
where: {
|
where: {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
|||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
try {
|
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) {
|
} catch (error) {
|
||||||
console.error(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 });
|
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||||
|
|||||||
Reference in New Issue
Block a user