summaryrefslogtreecommitdiff
path: root/system/db/config.go
diff options
context:
space:
mode:
authorTornike Razmadze <torniker@gmail.com>2017-06-26 22:02:08 +0400
committerTornike Razmadze <torniker@gmail.com>2017-06-26 22:02:08 +0400
commitefbc295ba2c4e5e30f358ac28afccaf243bc6298 (patch)
tree8aab520c7724b75261e45be2ceb46953339b08fe /system/db/config.go
parentf4c5d79810352d42ebcab92b52e7c53b9bc782b3 (diff)
fixed problem with saving multiple repeaters closes #59 closes #167
Diffstat (limited to 'system/db/config.go')
-rw-r--r--system/db/config.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/system/db/config.go b/system/db/config.go
index 5bb010a..c67fbe3 100644
--- a/system/db/config.go
+++ b/system/db/config.go
@@ -36,7 +36,6 @@ func SetConfig(data url.Values) error {
// and correctly format for db storage. Essentially, we need
// fieldX.0: value1, fieldX.1: value2 => fieldX: []string{value1, value2}
fieldOrderValue := make(map[string]map[string][]string)
- ordVal := make(map[string][]string)
for k, v := range data {
if strings.Contains(k, ".") {
fo := strings.Split(k, ".")
@@ -44,7 +43,9 @@ func SetConfig(data url.Values) error {
// put the order and the field value into map
field := string(fo[0])
order := string(fo[1])
- fieldOrderValue[field] = ordVal
+ if len(fieldOrderValue[field]) == 0 {
+ fieldOrderValue[field] = make(map[string][]string)
+ }
// orderValue is 0:[?type=Thing&id=1]
orderValue := fieldOrderValue[field]