feat(out-of-office): Migrate frontend to OCS endpoint

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/41957/head
Joas Schilling 2 years ago
parent 6eef5c9f1b
commit 2abf8e921b
No known key found for this signature in database
GPG Key ID: 74434EFE0D2E2205
  1. 7
      apps/dav/src/components/AbsenceForm.vue
  2. 4
      dist/dav-settings-personal-availability.js
  3. 2
      dist/dav-settings-personal-availability.js.map

@ -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) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save