status -> statusCode

This commit is contained in:
2026-01-20 17:40:49 +00:00
parent 9670293b51
commit 45448862c7
5 changed files with 7 additions and 7 deletions

View File

@@ -4,7 +4,7 @@ export default defineEventHandler(async (event) => {
const body = await readBody(event)
if (body.new_pw !== body.confirm_new_pw)
throw createError({status:400, message: "Passwords don't match!"})
throw createError({statusCode: 400, statusMessage: "Passwords don't match!"})
const session = await getUserSession(event)
const config = await useRuntimeConfig(event)
@@ -35,7 +35,7 @@ export default defineEventHandler(async (event) => {
new URLSearchParams({ id: userId }))
if (!current_r.ok)
if (current_r.status == 404)
throw createError({status: 404, message: "User doesn't exist"})
throw createError({statusCode: 404, statusMessage: "User doesn't exist"})
await $fetch(config.fastapi_url + "/changepw", {
method: "POST",

View File

@@ -32,7 +32,7 @@ export default defineEventHandler(async (event) => {
if (!current_r.ok)
if (current_r.status == 404)
throw createError({ status: 404, message: "User not found"})
throw createError({ statusCode: 404, statusMessage: "User not found"})
const current_body = await current_r.json();