Skip to content

Commit 68ea1ba

Browse files
committed
feat(files): Support setting config for view query param
Signed-off-by: Christopher Ng <chrng8@gmail.com>
1 parent e8f448f commit 68ea1ba

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

apps/files/appinfo/routes.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@
6060
'url' => '/api/v1/views/{view}/{key}',
6161
'verb' => 'PUT'
6262
],
63+
[
64+
'name' => 'Api#setViewConfig',
65+
'url' => '/api/v1/views/{key}',
66+
'verb' => 'PUT'
67+
],
6368
[
6469
'name' => 'Api#getViewConfigs',
6570
'url' => '/api/v1/views',

apps/files/src/store/viewConfig.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ export const useViewConfigStore = function(...args) {
4444
* @param value
4545
*/
4646
async update(view: ViewId, key: string, value: string | number | boolean) {
47-
axios.put(generateUrl(`/apps/files/api/v1/views/${view}/${key}`), {
47+
const params = new URLSearchParams({ view })
48+
axios.put(generateUrl(`/apps/files/api/v1/views/${key}`), {
4849
value,
49-
})
50+
}, { params })
5051

5152
emit('files:viewconfig:updated', { view, key, value })
5253
},

0 commit comments

Comments
 (0)