Skip to content

Commit 40e63f3

Browse files
authored
[ENG-9638] add search by guid for contributors and moderators add modal (#743)
- Ticket: https://openscience.atlassian.net/browse/ENG-9638 - Feature flag: n/a ## Purpose Some user workflows rely on using the OSF profile identifiers to locate users reliably. This was possible previously (at least in most contributor searches), but is not any longer. ## Summary of Changes When adding contributors, searching by user GUID should call up that user. This can be implemented across all instances of this widget/modal. Requires API change
1 parent 49e2652 commit 40e63f3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/app/features/moderation/services/moderators.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class ModeratorsService {
8585
}
8686

8787
searchUsers(value: string, page = 1): Observable<PaginatedData<ModeratorAddModel[]>> {
88-
const baseUrl = `${this.apiUrl}/users/?filter[full_name]=${value}&page=${page}`;
88+
const baseUrl = `${this.apiUrl}/search/users/?q=${value}*&page=${page}`;
8989

9090
return this.jsonApiService
9191
.get<ResponseJsonApi<UserDataJsonApi[]>>(baseUrl)

src/app/shared/services/contributors.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ export class ContributorsService {
9595
}
9696

9797
searchUsers(value: string, page = 1): Observable<PaginatedData<ContributorAddModel[]>> {
98-
const baseUrl = `${this.apiUrl}/users/?filter[full_name]=${value}&page=${page}`;
99-
98+
const baseUrl = `${this.apiUrl}/search/users/?q=${value}*&page=${page}`;
10099
return this.jsonApiService
101100
.get<ResponseJsonApi<UserDataJsonApi[]>>(baseUrl)
102101
.pipe(map((response) => ContributorsMapper.getPaginatedUsers(response)));

0 commit comments

Comments
 (0)