diff --git a/packages/webapp/src/classes/client/rest-client/index.ts b/packages/webapp/src/classes/client/rest-client/index.ts index 8288e974..2677886f 100644 --- a/packages/webapp/src/classes/client/rest-client/index.ts +++ b/packages/webapp/src/classes/client/rest-client/index.ts @@ -16,7 +16,24 @@ export default class RestClient implements Client { } // eslint-disable-next-line @typescript-eslint/no-unused-vars addMapPermissions(id: number, message: string, permissions: Permission[]): Promise { - throw new Error('Method not implemented.'); + const handler = (success: () => void, reject: (error: ErrorInfo) => void) => { + axios.put(`${this.baseUrl}/c/restful/maps/${id}/collabs/`, + { + messasge: message, + collaborations: permissions + }, + { headers: { 'Content-Type': 'application/json' } } + ).then(() => { + // All was ok, let's sent to success page ...; + success(); + }).catch(error => { + const errorInfo = this.parseResponseOnError(error.response); + reject(errorInfo); + }); + } + return new Promise(handler); + + } fetchMapPermissions(id: number): Promise { diff --git a/packages/webapp/src/components/maps-page/action-chooser/index.tsx b/packages/webapp/src/components/maps-page/action-chooser/index.tsx index 3fc3d804..b988d599 100644 --- a/packages/webapp/src/components/maps-page/action-chooser/index.tsx +++ b/packages/webapp/src/components/maps-page/action-chooser/index.tsx @@ -97,7 +97,7 @@ const ActionChooser = (props: ActionProps): React.ReactElement => { - {role != 'viewer' && + {role == 'owner' && @@ -106,7 +106,7 @@ const ActionChooser = (props: ActionProps): React.ReactElement => { } - {role != 'viewer' && + {role == 'owner' &&