mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix(settings): parse select as list
This commit is contained in:
parent
69f59a9a16
commit
56c35daed4
@ -367,19 +367,10 @@ func (h *SettingsHandler) actionAddLabel(w http.ResponseWriter, r *http.Request)
|
||||
|
||||
var labels []*models.ProjectLabel
|
||||
|
||||
if r.PostFormValue("num_projects") == "multiple" {
|
||||
for _, key := range r.Form["keys"] {
|
||||
label := &models.ProjectLabel{
|
||||
UserID: user.ID,
|
||||
ProjectKey: key,
|
||||
Label: r.PostFormValue("value"),
|
||||
}
|
||||
labels = append(labels, label)
|
||||
}
|
||||
} else {
|
||||
for _, key := range r.Form["key"] {
|
||||
label := &models.ProjectLabel{
|
||||
UserID: user.ID,
|
||||
ProjectKey: r.PostFormValue("key"),
|
||||
ProjectKey: key,
|
||||
Label: r.PostFormValue("value"),
|
||||
}
|
||||
labels = append(labels, label)
|
||||
|
@ -295,7 +295,7 @@
|
||||
<input type="hidden" name="num_projects" value="multiple">
|
||||
<div class="mt-2 w-1/2 space-y-4 text-gray-500 text-sm flex-col flex">
|
||||
<input class="input-default block" name="value" placeholder="Label" required>
|
||||
<select name="keys" class="block w-full p-2.5 select-default grow" multiple required>
|
||||
<select name="key" class="block w-full p-2.5 select-default grow" multiple required>
|
||||
{{ range $i, $p := .Projects }}
|
||||
<option value="{{ $p }}">{{ $p }}</option>
|
||||
{{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user