fixed signup and renaming problems

This commit is contained in:
2024-03-12 17:46:44 +01:00
parent d1bdffb834
commit acae90ee13
17 changed files with 96 additions and 78 deletions

14
server/api/signup.ts Normal file
View File

@ -0,0 +1,14 @@
import { errorMsg } from "../middleware/signUp";
export default defineEventHandler(async (event) => {
if (!(errorMsg === '')) {
throw createError({
statusCode: 400,
statusMessage: errorMsg,
})
}
setResponseStatus(event, 202)
return 'Successfully signed up.'
})

View File

@ -17,7 +17,7 @@ export default defineEventHandler(async (event) => {
httpsAgent: agent
});
if (event.path.startsWith("/api/signup")) {
if (event.path.startsWith("/signup")) {
const body = await readBody(event)
// do the post request in the backend