Require email on Volunteer entry.
This commit is contained in:
parent
3429ee92fe
commit
e7e542c03c
2 changed files with 6 additions and 2 deletions
|
|
@ -190,8 +190,8 @@
|
||||||
<input id="v-ticket-name" bind:value={newTicketName} placeholder="Legal/ticketed name" />
|
<input id="v-ticket-name" bind:value={newTicketName} placeholder="Legal/ticketed name" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="v-email">Email</label>
|
<label for="v-email">Email *</label>
|
||||||
<input id="v-email" type="email" bind:value={newEmail} placeholder="email@example.com" />
|
<input id="v-email" type="email" bind:value={newEmail} required placeholder="email@example.com" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="v-dept">Department</label>
|
<label for="v-dept">Department</label>
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,10 @@ func (app *App) handleCreateVolunteer(w http.ResponseWriter, r *http.Request) {
|
||||||
writeError(w, "name is required", http.StatusBadRequest)
|
writeError(w, "name is required", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if v.Email == "" {
|
||||||
|
writeError(w, "email is required", http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
claims := claimsFromContext(r)
|
claims := claimsFromContext(r)
|
||||||
if claims.Role == "colead" {
|
if claims.Role == "colead" {
|
||||||
if v.DepartmentID == nil || !inSlice(*v.DepartmentID, claims.DeptIDs) {
|
if v.DepartmentID == nil || !inSlice(*v.DepartmentID, claims.DeptIDs) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue