feat: add api endpoint and UI to transfer a board to a different user

Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
Luka Trovic
2022-03-14 22:42:34 +01:00
committed by Julius Härtl
parent 3a4ec07103
commit bf9a51d167
5 changed files with 63 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ import { loadState } from '@nextcloud/initial-state'
import Vue from 'vue'
import Vuex from 'vuex'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import { generateOcsUrl, generateUrl } from '@nextcloud/router'
import { BoardApi } from '../services/BoardApi'
import actions from './actions'
import stack from './stack'
@@ -486,5 +486,11 @@ export default new Vuex.Store({
dispatch('loadBoardById', acl.boardId)
})
},
async transferOwnership({ commit }, { boardId, owner, newOwner }) {
await axios.put(generateUrl(`apps/deck/boards/${boardId}/transferOwner`), {
owner,
newOwner,
})
},
},
})