Adjust generateOcsUrl calls
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -84,7 +84,7 @@ export default {
|
|||||||
params.append('object_id', '' + this.objectId)
|
params.append('object_id', '' + this.objectId)
|
||||||
params.append('limit', ACTIVITY_FETCH_LIMIT)
|
params.append('limit', ACTIVITY_FETCH_LIMIT)
|
||||||
|
|
||||||
const response = await axios.get(generateOcsUrl('apps/activity/api/v2/activity') + this.filter + '?' + params)
|
const response = await axios.get(generateOcsUrl(`apps/activity/api/v2/activity/${this.filter}`) + '?' + params)
|
||||||
let activities = response.data.ocs.data
|
let activities = response.data.ocs.data
|
||||||
if (this.filter === 'deck') {
|
if (this.filter === 'deck') {
|
||||||
// We need to manually filter activities here, since currently we use two different types and there is no way
|
// We need to manually filter activities here, since currently we use two different types and there is no way
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ export default {
|
|||||||
throw new Error(t('files', 'Invalid path selected'))
|
throw new Error(t('files', 'Invalid path selected'))
|
||||||
}
|
}
|
||||||
|
|
||||||
axios.post(generateOcsUrl('apps/files_sharing/api/v1', 2) + 'shares', {
|
axios.post(generateOcsUrl('apps/files_sharing/api/v1/shares'), {
|
||||||
path,
|
path,
|
||||||
shareType: 12,
|
shareType: 12,
|
||||||
shareWith: '' + this.cardId,
|
shareWith: '' + this.cardId,
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ export default {
|
|||||||
if (this.isAdmin) {
|
if (this.isAdmin) {
|
||||||
this.groupLimit = this.$store.getters.config('groupLimit')
|
this.groupLimit = this.$store.getters.config('groupLimit')
|
||||||
this.groupLimitDisabled = false
|
this.groupLimitDisabled = false
|
||||||
axios.get(generateOcsUrl('cloud', 2) + 'groups').then((response) => {
|
axios.get(generateOcsUrl('cloud/groups')).then((response) => {
|
||||||
this.groups = response.data.ocs.data.groups.reduce((obj, item) => {
|
this.groups = response.data.ocs.data.groups.reduce((obj, item) => {
|
||||||
obj.push({
|
obj.push({
|
||||||
id: item,
|
id: item,
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const createCancelToken = () => axios.CancelToken.source()
|
|||||||
function search({ query, cursor }) {
|
function search({ query, cursor }) {
|
||||||
const cancelToken = createCancelToken()
|
const cancelToken = createCancelToken()
|
||||||
|
|
||||||
const request = async() => axios.get(generateOcsUrl('apps/deck/api/v1.0', 2) + '/search', {
|
const request = async() => axios.get(generateOcsUrl('apps/deck/api/v1.0/search'), {
|
||||||
cancelToken: cancelToken.token,
|
cancelToken: cancelToken.token,
|
||||||
params: {
|
params: {
|
||||||
term: query,
|
term: query,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export class CommentApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async loadComments({ cardId, limit, offset }) {
|
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 },
|
params: { limit, offset },
|
||||||
headers: { 'OCS-APIRequest': 'true' },
|
headers: { 'OCS-APIRequest': 'true' },
|
||||||
})
|
})
|
||||||
@@ -39,7 +39,7 @@ export class CommentApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createComment({ cardId, comment, replyTo }) {
|
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}`,
|
message: `${comment}`,
|
||||||
parentId: replyTo ? replyTo.id : null,
|
parentId: replyTo ? replyTo.id : null,
|
||||||
})
|
})
|
||||||
@@ -47,14 +47,14 @@ export class CommentApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async updateComment({ cardId, id, comment }) {
|
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}`,
|
message: `${comment}`,
|
||||||
})
|
})
|
||||||
return api.data.ocs.data
|
return api.data.ocs.data
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteComment({ cardId, id }) {
|
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
|
return api.data.ocs.data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import { generateOcsUrl } from '@nextcloud/router'
|
|||||||
export class OverviewApi {
|
export class OverviewApi {
|
||||||
|
|
||||||
url(url) {
|
url(url) {
|
||||||
return generateOcsUrl('apps/deck/api/v1.0') + url
|
return generateOcsUrl(`apps/deck/api/v1.0/${url}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
get(filter) {
|
get(filter) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
import axios from '@nextcloud/axios'
|
import axios from '@nextcloud/axios'
|
||||||
import { generateOcsUrl } from '@nextcloud/router'
|
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 }) {
|
const createShare = async function({ path, permissions, shareType, shareWith, publicUpload, password, sendPasswordByTalk, expireDate, label }) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ export default new Vuex.Store({
|
|||||||
async setConfig({ commit }, config) {
|
async setConfig({ commit }, config) {
|
||||||
for (const key in config) {
|
for (const key in config) {
|
||||||
try {
|
try {
|
||||||
await axios.post(generateOcsUrl('apps/deck/api/v1.0/config') + key, {
|
await axios.post(generateOcsUrl(`apps/deck/api/v1.0/config/${key}`), {
|
||||||
value: config[key],
|
value: config[key],
|
||||||
})
|
})
|
||||||
commit('SET_CONFIG', { key, value: config[key] })
|
commit('SET_CONFIG', { key, value: config[key] })
|
||||||
@@ -421,7 +421,7 @@ export default new Vuex.Store({
|
|||||||
params.append('perPage', 20)
|
params.append('perPage', 20)
|
||||||
params.append('itemType', [0, 1, 4, 7])
|
params.append('itemType', [0, 1, 4, 7])
|
||||||
|
|
||||||
const response = await axios.get(generateOcsUrl('apps/files_sharing/api/v1') + 'sharees', { params })
|
const response = await axios.get(generateOcsUrl('apps/files_sharing/api/v1/sharees'), { params })
|
||||||
commit('setSharees', response.data.ocs.data)
|
commit('setSharees', response.data.ocs.data)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user