Adjust generateOcsUrl calls
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -31,7 +31,7 @@ export class CommentApi {
|
||||
}
|
||||
|
||||
async loadComments({ cardId, limit, offset }) {
|
||||
const api = await axios.get(generateOcsUrl('apps/deck/api/v1.0/cards', 2) + `${cardId}/comments`, {
|
||||
const api = await axios.get(generateOcsUrl(`apps/deck/api/v1.0/cards${cardId}/comments`), {
|
||||
params: { limit, offset },
|
||||
headers: { 'OCS-APIRequest': 'true' },
|
||||
})
|
||||
@@ -39,7 +39,7 @@ export class CommentApi {
|
||||
}
|
||||
|
||||
async createComment({ cardId, comment, replyTo }) {
|
||||
const api = await axios.post(generateOcsUrl('apps/deck/api/v1.0/cards', 2) + `${cardId}/comments`, {
|
||||
const api = await axios.post(generateOcsUrl(`apps/deck/api/v1.0/cards/${cardId}/comments`), {
|
||||
message: `${comment}`,
|
||||
parentId: replyTo ? replyTo.id : null,
|
||||
})
|
||||
@@ -47,14 +47,14 @@ export class CommentApi {
|
||||
}
|
||||
|
||||
async updateComment({ cardId, id, comment }) {
|
||||
const api = await axios.put(generateOcsUrl('apps/deck/api/v1.0/cards', 2) + `${cardId}/comments/${id}`, {
|
||||
const api = await axios.put(generateOcsUrl(`apps/deck/api/v1.0/cards/${cardId}/comments/${id}`), {
|
||||
message: `${comment}`,
|
||||
})
|
||||
return api.data.ocs.data
|
||||
}
|
||||
|
||||
async deleteComment({ cardId, id }) {
|
||||
const api = await axios.delete(generateOcsUrl('apps/deck/api/v1.0/cards', 2) + `${cardId}/comments/${id}`)
|
||||
const api = await axios.delete(generateOcsUrl(`apps/deck/api/v1.0/cards/${cardId}/comments/${id}`))
|
||||
return api.data.ocs.data
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import { generateOcsUrl } from '@nextcloud/router'
|
||||
export class OverviewApi {
|
||||
|
||||
url(url) {
|
||||
return generateOcsUrl('apps/deck/api/v1.0') + url
|
||||
return generateOcsUrl(`apps/deck/api/v1.0/${url}`)
|
||||
}
|
||||
|
||||
get(filter) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateOcsUrl } from '@nextcloud/router'
|
||||
|
||||
const shareUrl = generateOcsUrl('apps/files_sharing/api/v1', 2) + 'shares'
|
||||
const shareUrl = generateOcsUrl('apps/files_sharing/api/v1/shares')
|
||||
|
||||
const createShare = async function({ path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label }) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user