0
0
Fork 0
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:
Jonathan Treffler 2024-11-26 23:56:57 +01:00
parent 826db21508
commit 87661fafeb

View file

@ -40,7 +40,7 @@ var ResourceMemberPermissionLevels = {
/**
* @typedef {{
* id: number
* type: string
* type: ResourceType
* organizationFolderId: number
* name: string
* parentResource: number
@ -58,6 +58,8 @@ var ResourceMemberPermissionLevels = {
* @typedef {{
* type: PrincipalType,
* id: string,
* friendlyName: string
* fullHierarchyNames: string[]
* }} Principal
*
* @typedef {{
@ -104,12 +106,42 @@ export default {
* managersAclPermission: number|undefined
* inheritedAclPermission: number|undefined
* }} updateResourceDto UpdateResourceDto
* @param string include
* @return {Promise<Resource>}
*/
updateResource(resourceId, updateGroupDto, include = "model") {
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
* @return {Promise<Array<ResourceMember>>}