aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/src
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-12-01 09:16:01 +0100
committerJoas Schilling <coding@schilljs.com>2023-12-01 09:16:01 +0100
commit2abf8e921b037b9ea0967c440f4606cf5cc22a01 (patch)
treea09acdc7ddbd159f457473d119064f5a873ad4de /apps/dav/src
parent6eef5c9f1bec391fdb95e92190238a5c70dbce25 (diff)
downloadnextcloud-server-2abf8e921b037b9ea0967c440f4606cf5cc22a01.tar.gz
nextcloud-server-2abf8e921b037b9ea0967c440f4606cf5cc22a01.zip
feat(out-of-office): Migrate frontend to OCS endpoint
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/src')
-rw-r--r--apps/dav/src/components/AbsenceForm.vue7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/dav/src/components/AbsenceForm.vue b/apps/dav/src/components/AbsenceForm.vue
index 6fb1c4ce1fd..f43fb889b9e 100644
--- a/apps/dav/src/components/AbsenceForm.vue
+++ b/apps/dav/src/components/AbsenceForm.vue
@@ -57,7 +57,8 @@ import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import NcTextArea from '@nextcloud/vue/dist/Components/NcTextArea.js'
import NcDateTimePickerNative from '@nextcloud/vue/dist/Components/NcDateTimePickerNative.js'
-import { generateUrl } from '@nextcloud/router'
+import { generateOcsUrl } from '@nextcloud/router'
+import { getCurrentUser } from '@nextcloud/auth'
import axios from '@nextcloud/axios'
import { formatDateAsYMD } from '../utils/date.js'
import { loadState } from '@nextcloud/initial-state'
@@ -116,7 +117,7 @@ export default {
this.loading = true
try {
- await axios.post(generateUrl('/apps/dav/settings/absence'), {
+ await axios.post(generateOcsUrl('/apps/dav/api/v1/outOfOffice/{userId}', { userId: getCurrentUser().uid }), {
firstDay: formatDateAsYMD(this.firstDay),
lastDay: formatDateAsYMD(this.lastDay),
status: this.status,
@@ -133,7 +134,7 @@ export default {
async clearAbsence() {
this.loading = true
try {
- await axios.delete(generateUrl('/apps/dav/settings/absence'))
+ await axios.delete(generateOcsUrl('/apps/dav/api/v1/outOfOffice/{userId}', { userId: getCurrentUser().uid }))
this.resetForm()
showSuccess(this.$t('dav', 'Absence cleared'))
} catch (error) {