sessions: let's be an OCS API to support extenal clients

Signed-off-by: chandi Langecker <git@chandi.it>
This commit is contained in:
chandi Langecker
2022-11-12 15:13:45 +01:00
parent 5386e6e24f
commit ccf73736c4
4 changed files with 118 additions and 88 deletions

View File

@@ -19,17 +19,16 @@
*/
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'
import { generateOcsUrl } from '@nextcloud/router'
export class SessionApi {
url(url) {
url = `/apps/deck${url}`
return generateUrl(url)
return generateOcsUrl(`apps/deck/api/v1.0${url}`)
}
async createSession(boardId) {
return (await axios.put(this.url('/session/create'), { boardId })).data
return (await axios.put(this.url('/session/create'), { boardId })).data.ocs.data
}
async syncSession(boardId, token) {