From bf2a9aa46d886d9032f1c6f2e95e44aa97f30525 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 18 Aug 2023 12:52:16 +0200 Subject: [PATCH] fix(CS): Use the naming pattern for the URL scheme Signed-off-by: Joas Schilling --- apps/files_reminders/appinfo/routes.php | 6 +++--- apps/files_reminders/src/services/reminderService.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/files_reminders/appinfo/routes.php b/apps/files_reminders/appinfo/routes.php index 8dfd785669b..7f022a280ab 100644 --- a/apps/files_reminders/appinfo/routes.php +++ b/apps/files_reminders/appinfo/routes.php @@ -30,8 +30,8 @@ $requirements = [ return [ 'ocs' => [ - ['name' => 'Api#get', 'url' => '/api/v{version}/get/{fileId}', 'verb' => 'GET', 'requirements' => $requirements], - ['name' => 'Api#set', 'url' => '/api/v{version}/set/{fileId}', 'verb' => 'PUT', 'requirements' => $requirements], - ['name' => 'Api#remove', 'url' => '/api/v{version}/remove/{fileId}', 'verb' => 'DELETE', 'requirements' => $requirements], + ['name' => 'Api#get', 'url' => '/api/v{version}/{fileId}', 'verb' => 'GET', 'requirements' => $requirements], + ['name' => 'Api#set', 'url' => '/api/v{version}/{fileId}', 'verb' => 'PUT', 'requirements' => $requirements], + ['name' => 'Api#remove', 'url' => '/api/v{version}/{fileId}', 'verb' => 'DELETE', 'requirements' => $requirements], ], ]; diff --git a/apps/files_reminders/src/services/reminderService.ts b/apps/files_reminders/src/services/reminderService.ts index eacb6e2834e..06163b601cb 100644 --- a/apps/files_reminders/src/services/reminderService.ts +++ b/apps/files_reminders/src/services/reminderService.ts @@ -28,7 +28,7 @@ interface Reminder { } export const getReminder = async (fileId: number): Promise => { - const url = generateOcsUrl('/apps/files_reminders/api/v1/get/{fileId}', { fileId }) + const url = generateOcsUrl('/apps/files_reminders/api/v1/{fileId}', { fileId }) const response = await axios.get(url) const dueDate = response.data.ocs.data.dueDate ? new Date(response.data.ocs.data.dueDate) : null @@ -38,7 +38,7 @@ export const getReminder = async (fileId: number): Promise => { } export const setReminder = async (fileId: number, dueDate: Date): Promise<[]> => { - const url = generateOcsUrl('/apps/files_reminders/api/v1/set/{fileId}', { fileId }) + const url = generateOcsUrl('/apps/files_reminders/api/v1/{fileId}', { fileId }) const response = await axios.put(url, { dueDate: dueDate.toISOString(), // timezone of string is always UTC @@ -48,7 +48,7 @@ export const setReminder = async (fileId: number, dueDate: Date): Promise<[]> => } export const clearReminder = async (fileId: number): Promise<[]> => { - const url = generateOcsUrl('/apps/files_reminders/api/v1/remove/{fileId}', { fileId }) + const url = generateOcsUrl('/apps/files_reminders/api/v1/{fileId}', { fileId }) const response = await axios.delete(url) return response.data.ocs.data -- 2.39.5