@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import './../models'
|
||||
|
||||
/**
|
||||
@@ -30,7 +31,7 @@ export class BoardApi {
|
||||
|
||||
url(url) {
|
||||
url = `/apps/deck${url}`
|
||||
return OC.generateUrl(url)
|
||||
return generateUrl(url)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,12 +21,13 @@
|
||||
*/
|
||||
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
|
||||
export class CardApi {
|
||||
|
||||
url(url) {
|
||||
url = `/apps/deck${url}`
|
||||
return OC.generateUrl(url)
|
||||
return generateUrl(url)
|
||||
}
|
||||
|
||||
addCard(card) {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import xmlToTagList from '../helpers/xml'
|
||||
|
||||
export class CommentApi {
|
||||
@@ -31,7 +32,7 @@ export class CommentApi {
|
||||
}
|
||||
|
||||
async loadComments({ cardId, limit, offset }) {
|
||||
const api = await axios.get(OC.generateUrl(`/apps/deck/api/v1.0/boards/0/stacks/0/cards/${cardId}/comments`), {
|
||||
const api = await axios.get(generateUrl(`/apps/deck/api/v1.0/boards/0/stacks/0/cards/${cardId}/comments`), {
|
||||
headers: { 'OCS-APIRequest': 'true' },
|
||||
})
|
||||
return api.data
|
||||
@@ -61,7 +62,7 @@ export class CommentApi {
|
||||
}
|
||||
|
||||
async createComment({ cardId, comment, replyTo }) {
|
||||
const api = await axios.post(OC.generateUrl(`/apps/deck/api/v1.0/boards/0/stacks/0/cards/${cardId}/comments`), {
|
||||
const api = await axios.post(generateUrl(`/apps/deck/api/v1.0/boards/0/stacks/0/cards/${cardId}/comments`), {
|
||||
message: `${comment}`,
|
||||
parentId: replyTo ? replyTo.id : null,
|
||||
})
|
||||
@@ -69,14 +70,14 @@ export class CommentApi {
|
||||
}
|
||||
|
||||
async updateComment({ cardId, commentId, comment }) {
|
||||
const api = await axios.put(OC.generateUrl(`/apps/deck/api/v1.0/boards/0/stacks/0/cards/${cardId}/comments/${commentId}`), {
|
||||
const api = await axios.put(generateUrl(`/apps/deck/api/v1.0/boards/0/stacks/0/cards/${cardId}/comments/${commentId}`), {
|
||||
message: `${comment}`,
|
||||
})
|
||||
return api.data
|
||||
}
|
||||
|
||||
async deleteComment({ cardId, commentId }) {
|
||||
const api = await axios.delete(OC.generateUrl(`/apps/deck/api/v1.0/boards/0/stacks/0/cards/${cardId}/comments/${commentId}`))
|
||||
const api = await axios.delete(generateUrl(`/apps/deck/api/v1.0/boards/0/stacks/0/cards/${cardId}/comments/${commentId}`))
|
||||
return api.data
|
||||
}
|
||||
|
||||
|
||||
@@ -21,13 +21,14 @@
|
||||
*/
|
||||
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import './../models'
|
||||
|
||||
export class StackApi {
|
||||
|
||||
url(url) {
|
||||
url = `/apps/deck${url}`
|
||||
return OC.generateUrl(url)
|
||||
return generateUrl(url)
|
||||
}
|
||||
|
||||
loadStacks(boardId) {
|
||||
|
||||
Reference in New Issue
Block a user