260707_01_ENH: 모니터링 출발/도착 버튼은 모니터링 일자 이후로 부터 노출되게 수정 및 관리자는 출발 도착 삭제 가능하게 수정
This commit is contained in:
@@ -98,3 +98,26 @@ export const POST = async (
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const DELETE = async (
|
||||
req: NextRequest,
|
||||
context: RouteContext
|
||||
) => {
|
||||
try {
|
||||
void req;
|
||||
const {slug = []} = await context.params;
|
||||
const [action, subAction, performanceId, userId] = slug;
|
||||
const backApi = await createBackApi();
|
||||
|
||||
if (action === "visit" && subAction === "reset" && performanceId && userId && slug.length === 4) {
|
||||
await backApi.del<void>(
|
||||
`/monitoring/visit/reset/${encodeURIComponent(performanceId)}/${encodeURIComponent(userId)}`
|
||||
);
|
||||
return NextResponse.json(null, { status: 200 });
|
||||
}
|
||||
|
||||
return NextResponse.json({ message: "Not found" }, { status: 404 });
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user