fix broken build,
This commit is contained in:
@@ -2,7 +2,7 @@ import type { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { STATUS, response, handleError } from 'src/utils/response';
|
||||
|
||||
import { listAppLogs, deleteAppLog, updateAppLog, createNewAppLog } from 'src/app/services/AppLog.service';
|
||||
import { listAppLogs, deleteAppLog, createNewAppLog } from 'src/app/services/AppLog.service';
|
||||
|
||||
// import prisma from '../../lib/prisma';
|
||||
|
||||
@@ -34,28 +34,29 @@ export async function POST(req: NextRequest) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
***************************************
|
||||
* PUT - update AppLog
|
||||
***************************************
|
||||
*/
|
||||
export async function PUT(req: NextRequest) {
|
||||
const { searchParams } = req.nextUrl;
|
||||
const appLogId = searchParams.get('appLogId');
|
||||
// TODO: delete `update AppLog`
|
||||
// /**
|
||||
// ***************************************
|
||||
// * PUT - update AppLog
|
||||
// ***************************************
|
||||
// */
|
||||
// export async function PUT(req: NextRequest) {
|
||||
// const { searchParams } = req.nextUrl;
|
||||
// const appLogId = searchParams.get('appLogId');
|
||||
|
||||
const { data } = await req.json();
|
||||
// const { data } = await req.json();
|
||||
|
||||
try {
|
||||
if (!appLogId) throw new Error('appLogId cannot null');
|
||||
const id: number = parseInt(appLogId);
|
||||
// try {
|
||||
// if (!appLogId) throw new Error('appLogId cannot null');
|
||||
// const id: number = parseInt(appLogId);
|
||||
|
||||
const updateResult = await updateAppLog(id, data);
|
||||
// const updateResult = await updateAppLog(id, data);
|
||||
|
||||
return response(updateResult, STATUS.OK);
|
||||
} catch (error) {
|
||||
return handleError('AppLog - Update', error);
|
||||
}
|
||||
}
|
||||
// return response(updateResult, STATUS.OK);
|
||||
// } catch (error) {
|
||||
// return handleError('AppLog - Update', error);
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
***************************************
|
||||
@@ -72,7 +73,7 @@ export async function DELETE(req: NextRequest) {
|
||||
if (!appLogId) throw new Error('appLogId cannot null');
|
||||
const id: number = parseInt(appLogId);
|
||||
|
||||
const deleteResult = await deleteAppLog(id);
|
||||
const deleteResult = await deleteAppLog(id.toString());
|
||||
|
||||
return response(deleteResult, STATUS.OK);
|
||||
} catch (error) {
|
||||
|
Reference in New Issue
Block a user