add types of group
This commit is contained in:
@@ -69,11 +69,18 @@ func (h *ApplicationHandler) CreateGroupModule(w http.ResponseWriter, r *http.Re
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
if r.FormValue("type") == "" {
|
||||
|
||||
fmt.Println("invalid type")
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
groupid := uuid.NewString()
|
||||
|
||||
dataMap := map[string]any{
|
||||
"name": r.FormValue("name"),
|
||||
"type": r.FormValue("type"),
|
||||
}
|
||||
|
||||
data, err := structpb.NewValue(dataMap)
|
||||
@@ -101,7 +108,8 @@ func (h *ApplicationHandler) CreateGroupModule(w http.ResponseWriter, r *http.Re
|
||||
http.Redirect(w, r, fmt.Sprintf("/app/group_module/groups/%s", groupid), http.StatusFound)
|
||||
return
|
||||
}
|
||||
h.Renderer.CreateGroupModule(w, r)
|
||||
group_types := h.config.GetStringSlice("modules.groups.group_types")
|
||||
h.Renderer.CreateGroupModule(w, r, group_types)
|
||||
}
|
||||
|
||||
func filterAcccount(r *http.Request, a *mobilityaccounts.Account) bool {
|
||||
|
||||
Reference in New Issue
Block a user