From 662d3ba69d28f116a5206b89fccc323d9ec73e35 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 25 Jul 2024 15:16:11 -0700 Subject: [PATCH] feat(files): Support setting config for view query param Signed-off-by: Christopher Ng --- apps/files/appinfo/routes.php | 5 +++++ apps/files/src/store/viewConfig.ts | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/files/appinfo/routes.php b/apps/files/appinfo/routes.php index 8d1a33d6b4cd0..a3c6836366e6a 100644 --- a/apps/files/appinfo/routes.php +++ b/apps/files/appinfo/routes.php @@ -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', diff --git a/apps/files/src/store/viewConfig.ts b/apps/files/src/store/viewConfig.ts index f3021077c5466..6b87b974d2864 100644 --- a/apps/files/src/store/viewConfig.ts +++ b/apps/files/src/store/viewConfig.ts @@ -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 }) },