diff --git a/src/faculty_controller.v b/src/faculty_controller.v index fd41036..0254387 100644 --- a/src/faculty_controller.v +++ b/src/faculty_controller.v @@ -2,9 +2,11 @@ module main import vweb - @['/controller/faculty'; post] -pub fn (mut app App) controller_get_faculty(email string, password string) vweb.Result { +pub fn (mut app App) controller_get_faculty() vweb.Result { + email := app.query['email'] + password := app.query['password'] + response := app.service_get_faculty(email, password) or { app.set_status(400, '') return app.text('${err}') @@ -13,7 +15,12 @@ pub fn (mut app App) controller_get_faculty(email string, password string) vweb. } @['/controller/faculty/create'; post] -pub fn (mut app App) controller_create_faculty(firstname string, lastname string, email string, password string) vweb.Result { +pub fn (mut app App) controller_create_faculty() vweb.Result { + firstname := app.query['firstname'] + lastname := app.query['lastname'] + email := app.query['email'] + password := app.query['password'] + if firstname == '' { app.set_status(400, '') return app.text('firstname cannot be empty')