mirror of
https://github.com/verdigado/organization_folders.git
synced 2024-12-06 11:22:41 +01:00
added createResource and deleteResource to frontend api controller
This commit is contained in:
parent
826db21508
commit
87661fafeb
1 changed files with 33 additions and 1 deletions
34
src/api.js
34
src/api.js
|
@ -40,7 +40,7 @@ var ResourceMemberPermissionLevels = {
|
||||||
/**
|
/**
|
||||||
* @typedef {{
|
* @typedef {{
|
||||||
* id: number
|
* id: number
|
||||||
* type: string
|
* type: ResourceType
|
||||||
* organizationFolderId: number
|
* organizationFolderId: number
|
||||||
* name: string
|
* name: string
|
||||||
* parentResource: number
|
* parentResource: number
|
||||||
|
@ -58,6 +58,8 @@ var ResourceMemberPermissionLevels = {
|
||||||
* @typedef {{
|
* @typedef {{
|
||||||
* type: PrincipalType,
|
* type: PrincipalType,
|
||||||
* id: string,
|
* id: string,
|
||||||
|
* friendlyName: string
|
||||||
|
* fullHierarchyNames: string[]
|
||||||
* }} Principal
|
* }} Principal
|
||||||
*
|
*
|
||||||
* @typedef {{
|
* @typedef {{
|
||||||
|
@ -104,12 +106,42 @@ export default {
|
||||||
* managersAclPermission: number|undefined
|
* managersAclPermission: number|undefined
|
||||||
* inheritedAclPermission: number|undefined
|
* inheritedAclPermission: number|undefined
|
||||||
* }} updateResourceDto UpdateResourceDto
|
* }} updateResourceDto UpdateResourceDto
|
||||||
|
* @param string include
|
||||||
* @return {Promise<Resource>}
|
* @return {Promise<Resource>}
|
||||||
*/
|
*/
|
||||||
updateResource(resourceId, updateGroupDto, include = "model") {
|
updateResource(resourceId, updateGroupDto, include = "model") {
|
||||||
return axios.put(`/resources/${resourceId}`, { ...updateGroupDto, include }).then((res) => res.data);
|
return axios.put(`/resources/${resourceId}`, { ...updateGroupDto, include }).then((res) => res.data);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {{
|
||||||
|
* type: ResourceType
|
||||||
|
* organizationFolderId: number
|
||||||
|
* name: string
|
||||||
|
* parentResourceId: number|undefined
|
||||||
|
* active: bool
|
||||||
|
* inheritManagers: bool
|
||||||
|
*
|
||||||
|
* membersAclPermission: number|undefined
|
||||||
|
* managersAclPermission: number|undefined
|
||||||
|
* inheritedAclPermission: number|undefined
|
||||||
|
* }} createResourceDto CreateResourceDto
|
||||||
|
* @param string include
|
||||||
|
* @return {Promise<Resource>}
|
||||||
|
*/
|
||||||
|
createResource(createGroupDto, include = "model") {
|
||||||
|
return axios.post(`/resources`, { ...createGroupDto, include }).then((res) => res.data);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {number|string} resourceId Resource id
|
||||||
|
* @return {Promise<Resource>}
|
||||||
|
*/
|
||||||
|
deleteResource(resourceId) {
|
||||||
|
return axios.delete(`/resources/${resourceId}`).then((res) => res.data);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number|string} resourceId Resource id
|
* @param {number|string} resourceId Resource id
|
||||||
* @return {Promise<Array<ResourceMember>>}
|
* @return {Promise<Array<ResourceMember>>}
|
||||||
|
|
Loading…
Reference in a new issue