@equinor/fusion
Advanced tools
Comparing version 0.4.10 to 0.4.11
import BaseApiClient from './BaseApiClient'; | ||
import { combineUrls } from '../../utils/url'; | ||
export default class OrgClient extends BaseApiClient { | ||
@@ -27,10 +28,26 @@ async getProjectAsync(projectId) { | ||
} | ||
// TODO: Replaced with the commented method below when backend is ready | ||
async updatePositionAsync(projectId, position) { | ||
const url = this.resourceCollections.org.position(projectId, position.id); | ||
return await this.httpClient.putAsync(url, position, { | ||
headers: { | ||
'api-version': '2.0', | ||
}, | ||
const isSupport = position.properties.isSupport === true; | ||
const parentPositionId = position.parentPositionId; | ||
if (parentPositionId) { | ||
await this.httpClient.postAsync(combineUrls(this.resourceCollections.org.position(projectId, position.id, false), 'parentPositionId', parentPositionId), null); | ||
} | ||
return await this.httpClient.patchAsync(this.resourceCollections.org.position(projectId, position.id), { | ||
isSupport, | ||
}); | ||
} | ||
// TODO: Backend not implemented for v2.0 yet | ||
// async updatePositionAsync(projectId: string, position: Position) { | ||
// const url = this.resourceCollections.org.position(projectId, position.id); | ||
// return await this.httpClient.putAsync<Position, Position, FusionApiHttpErrorResponse>( | ||
// url, | ||
// position, | ||
// { | ||
// headers: { | ||
// 'api-version': '2.0', | ||
// }, | ||
// } | ||
// ); | ||
// } | ||
async getRoleDescriptionAsync(projectId, positionId) { | ||
@@ -37,0 +54,0 @@ const url = this.resourceCollections.org.roleDescription(projectId, positionId); |
@@ -1,2 +0,2 @@ | ||
declare const _default: "0.4.10"; | ||
declare const _default: "0.4.11"; | ||
export default _default; |
@@ -1,1 +0,1 @@ | ||
export default '0.4.10'; | ||
export default '0.4.11'; |
{ | ||
"name": "@equinor/fusion", | ||
"version": "0.4.10", | ||
"version": "0.4.11", | ||
"description": "Everything a Fusion app needs to communicate with the core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
175838
4168