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],
],
];
}
export const getReminder = async (fileId: number): Promise<Reminder> => {
- 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
}
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
}
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