1
0
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:
Diptesh Choudhuri
2023-01-25 03:14:25 +00:00
parent 69f59a9a16
commit 56c35daed4
2 changed files with 3 additions and 12 deletions

View File

@ -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)