14
This commit is contained in:
@@ -2,9 +2,11 @@ module main
|
|||||||
|
|
||||||
import vweb
|
import vweb
|
||||||
|
|
||||||
|
|
||||||
@['/controller/faculty'; post]
|
@['/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 {
|
response := app.service_get_faculty(email, password) or {
|
||||||
app.set_status(400, '')
|
app.set_status(400, '')
|
||||||
return app.text('${err}')
|
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]
|
@['/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 == '' {
|
if firstname == '' {
|
||||||
app.set_status(400, '')
|
app.set_status(400, '')
|
||||||
return app.text('firstname cannot be empty')
|
return app.text('firstname cannot be empty')
|
||||||
|
Reference in New Issue
Block a user