fixed signup and renaming problems
This commit is contained in:
14
server/api/signup.ts
Normal file
14
server/api/signup.ts
Normal 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.'
|
||||
})
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user