Skip to content
Snippets Groups Projects
Commit e16f83e0 authored by Kawtar Laariche's avatar Kawtar Laariche
Browse files

#19: add get, add and delete with team functions

parent e603c16a
No related branches found
No related tags found
No related merge requests found
...@@ -53,4 +53,6 @@ export const apiConfig = { ...@@ -53,4 +53,6 @@ export const apiConfig = {
urlCreateRating: '/api/solution/createRating', urlCreateRating: '/api/solution/createRating',
urlThread: '/api/thread', urlThread: '/api/thread',
urlComment: '/api/comments', urlComment: '/api/comments',
urlGetActiveUsers: '/api/users/activeUserDetails',
urlShareWithTeam: '/api/solution/userAccess',
}; };
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
CommentModel, CommentModel,
PublicSolution, PublicSolution,
ThreadModel, ThreadModel,
UserDetails,
} from 'src/app/shared/models'; } from 'src/app/shared/models';
import { CreateRatingRequestPayload } from 'src/app/shared/models/request-payloads'; import { CreateRatingRequestPayload } from 'src/app/shared/models/request-payloads';
...@@ -335,4 +336,45 @@ export class PrivateCatalogsService { ...@@ -335,4 +336,45 @@ export class PrivateCatalogsService {
}), }),
); );
} }
getAllActiveUsers(activeStatus: boolean): Observable<UserDetails[]> {
const url = `${apiConfig.apiBackendURL}${apiConfig.urlGetActiveUsers}/${activeStatus}`;
return this._httpSharedService.get(url, undefined).pipe(
map((res) => res.response_body),
catchError((error) => {
throw error;
}),
);
}
getShareWithTeam(solutionId: string): Observable<UserDetails[]> {
const url = `${apiConfig.apiBackendURL}${apiConfig.urlShareWithTeam}/${solutionId}`;
return this._httpSharedService.get(url, undefined).pipe(
map((res) => res.response_body.userList),
catchError((error) => {
throw error;
}),
);
}
insertMultipleShare(userIds: string[], solutionId: string) {
const reqObj = {
request_body: userIds,
};
const url = `${apiConfig.apiBackendURL}${apiConfig.urlShareWithTeam}/${solutionId}/add`;
return this._httpSharedService.post(url, undefined, reqObj).pipe(
catchError((error) => {
throw error;
}),
);
}
deleteShareWithTeam(userId: string, solutionId: string) {
const url = `${apiConfig.apiBackendURL}${apiConfig.urlShareWithTeam}/${solutionId}/delete/${userId}`;
return this._httpSharedService.delete(url, undefined).pipe(
catchError((error) => {
throw error;
}),
);
}
} }
...@@ -69,6 +69,7 @@ export interface Catalog { ...@@ -69,6 +69,7 @@ export interface Catalog {
export interface Revision { export interface Revision {
revisionId: string; revisionId: string;
version: string; version: string;
onBoarded?: string;
} }
export interface AllUserRating { export interface AllUserRating {
......
...@@ -9,4 +9,5 @@ export interface UserDetails { ...@@ -9,4 +9,5 @@ export interface UserDetails {
lastLogin?: string; lastLogin?: string;
created?: string; created?: string;
modified?: string; modified?: string;
picture?: string;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment