diff --git a/src/app/api/mobile/auth-token/route.ts b/src/app/api/mobile/auth-token/route.ts index f8b8dde..74c3e18 100644 --- a/src/app/api/mobile/auth-token/route.ts +++ b/src/app/api/mobile/auth-token/route.ts @@ -45,7 +45,7 @@ export async function POST(request: Request) { export async function PUT(request: Request) { try { - const { token, user } = (await request.json()); + const { token, user, category } = (await request.json()); const userMobile = await funGetUserById({ id: user }) if (userMobile.id == "null" || userMobile.id == undefined || userMobile.id == "") { @@ -62,8 +62,10 @@ export async function PUT(request: Request) { } - // create log user - const log = await createLogUserMobile({ act: 'LOGOUT', desc: 'User logout', table: 'user', data: '', user: userMobile.id }) + if (category != "unregister") { + // create log user + const log = await createLogUserMobile({ act: 'LOGOUT', desc: 'User logout', table: 'user', data: '', user: userMobile.id }) + } return NextResponse.json({ success: true, message: "Berhasil menghapus token", }, { status: 200 }); } catch (error) {