Skip to content

Commit

Permalink
Merge pull request #1119 from CSCfi/CSCEXAM-1283
Browse files Browse the repository at this point in the history
CSCEXAM-1283 Collab exam search with no filter
  • Loading branch information
lupari authored Jun 19, 2024
2 parents f2f5834 + 60ba0cc commit 2dee393
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private Exam prepareDraft(User user) {

@Authenticated
@Restrict({ @Group("ADMIN"), @Group("TEACHER") })
public CompletionStage<Result> searchExams(Http.Request request, final Optional<String> filter) {
public CompletionStage<Result> searchExams(Http.Request request, Optional<String> filter) {
WSRequest wsRequest = getSearchRequest(filter);
User user = request.attrs().get(Attrs.AUTHENTICATED_USER);
String homeOrg = configReader.getHomeOrganisationRef();
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/enrolment/enrolment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class EnrolmentService {
this.http.get<CollaborativeParticipation[]>('/app/iop/student/finishedExams');

searchExams$ = (searchTerm: string): Observable<CollaborativeExam[]> => {
const paramStr = '?filter=' + (searchTerm?.length > 0 ? encodeURIComponent(searchTerm) : '');
const paramStr = searchTerm ? `?filter=${encodeURIComponent(searchTerm)}` : '';
const path = `/app/iop/enrolment${paramStr}`;
return this.http.get<CollaborativeExam[]>(path);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class CollaborativeExamService {
createExam$ = (): Observable<CollaborativeExam> => this.http.post<CollaborativeExam>('/app/iop/exams', {});

searchExams$ = (searchTerm: string): Observable<CollaborativeExam[]> => {
const paramStr = '?filter=' + (searchTerm && searchTerm.length > 0 ? encodeURIComponent(searchTerm) : '');
const paramStr = searchTerm ? `?filter=${encodeURIComponent(searchTerm)}` : '';
const path = `/app/iop/exams${paramStr}`;
return this.http.get<CollaborativeExam[]>(path);
};
Expand Down

0 comments on commit 2dee393

Please sign in to comment.