admin: POST /... expands and appends all array elements

Makes it easy to append many items to an array in one command
This commit is contained in:
Matthew Holt
2019-12-17 10:11:45 -07:00
parent 5ab17a3a37
commit 6455efa5d3
2 changed files with 39 additions and 6 deletions

View File

@ -77,6 +77,12 @@ func TestUnsyncedConfigAccess(t *testing.T) {
payload: `"d"`,
expect: `{"foo": "jet", "bar": {"aa": "bb"}, "list": ["a", "b", "c", "d"]}`,
},
{
method: "POST",
path: "/list/...",
payload: `["e", "f", "g"]`,
expect: `{"foo": "jet", "bar": {"aa": "bb"}, "list": ["a", "b", "c", "d", "e", "f", "g"]}`,
},
} {
err := unsyncedConfigAccess(tc.method, rawConfigKey+tc.path, []byte(tc.payload), nil)