Skip to content

Commit

Permalink
feat(files): Support setting config for view query param
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Jul 25, 2024
1 parent 3b67637 commit 662d3ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions apps/files/appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
'url' => '/api/v1/views/{view}/{key}',
'verb' => 'PUT'
],
[
'name' => 'Api#setViewConfig',
'url' => '/api/v1/views/{key}',
'verb' => 'PUT'
],
[
'name' => 'Api#getViewConfigs',
'url' => '/api/v1/views',
Expand Down
5 changes: 3 additions & 2 deletions apps/files/src/store/viewConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ export const useViewConfigStore = function(...args) {
* @param value
*/
async update(view: ViewId, key: string, value: string | number | boolean) {
axios.put(generateUrl(`/apps/files/api/v1/views/${view}/${key}`), {
const params = new URLSearchParams({ view })
axios.put(generateUrl(`/apps/files/api/v1/views/${key}`), {
value,
})
}, { params })

emit('files:viewconfig:updated', { view, key, value })
},
Expand Down

0 comments on commit 662d3ba

Please sign in to comment.