Merge pull request 'upd: unregistered token log logot' (#20) from amalia/04-mar-26 into join
Reviewed-on: #20
This commit is contained in:
@@ -45,7 +45,7 @@ export async function POST(request: Request) {
|
|||||||
|
|
||||||
export async function PUT(request: Request) {
|
export async function PUT(request: Request) {
|
||||||
try {
|
try {
|
||||||
const { token, user } = (await request.json());
|
const { token, user, category } = (await request.json());
|
||||||
|
|
||||||
const userMobile = await funGetUserById({ id: user })
|
const userMobile = await funGetUserById({ id: user })
|
||||||
if (userMobile.id == "null" || userMobile.id == undefined || userMobile.id == "") {
|
if (userMobile.id == "null" || userMobile.id == undefined || userMobile.id == "") {
|
||||||
@@ -62,8 +62,10 @@ export async function PUT(request: Request) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create log user
|
if (category != "unregister") {
|
||||||
const log = await createLogUserMobile({ act: 'LOGOUT', desc: 'User logout', table: 'user', data: '', user: userMobile.id })
|
// 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 });
|
return NextResponse.json({ success: true, message: "Berhasil menghapus token", }, { status: 200 });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user