Require email on Volunteer entry.
This commit is contained in:
parent
3429ee92fe
commit
e7e542c03c
2 changed files with 6 additions and 2 deletions
|
|
@ -46,6 +46,10 @@ func (app *App) handleCreateVolunteer(w http.ResponseWriter, r *http.Request) {
|
|||
writeError(w, "name is required", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if v.Email == "" {
|
||||
writeError(w, "email is required", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
claims := claimsFromContext(r)
|
||||
if claims.Role == "colead" {
|
||||
if v.DepartmentID == nil || !inSlice(*v.DepartmentID, claims.DeptIDs) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue