Added simple pagination to participants-list
This commit is contained in:
committed by
Erik Tiekstra
parent
8a9b0049d4
commit
0a5448ff4f
@@ -1,5 +1,6 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ParticipantStatus } from '@dafa-enums/participant-status.enum';
|
||||
import { environment } from '@dafa-environment';
|
||||
import { Participant } from '@dafa-models/participant.model';
|
||||
import { SortBy } from '@dafa-models/sort-by.model';
|
||||
@@ -47,7 +48,8 @@ export class ParticipantsService {
|
||||
this._activeParticipantsSortBy$,
|
||||
]).pipe(
|
||||
map(([participants, sortBy]) => {
|
||||
return sortBy ? sort(participants, sortBy) : participants;
|
||||
const activeParticipants = participants.filter(participant => participant.status === ParticipantStatus.ACTIVE);
|
||||
return sortBy ? sort(activeParticipants, sortBy) : activeParticipants;
|
||||
})
|
||||
);
|
||||
|
||||
@@ -56,7 +58,10 @@ export class ParticipantsService {
|
||||
this._followUpParticipantsSortBy$,
|
||||
]).pipe(
|
||||
map(([participants, sortBy]) => {
|
||||
return sortBy ? sort(participants, sortBy) : participants;
|
||||
const followUpParticipants = participants.filter(
|
||||
participant => participant.status === ParticipantStatus.FOLLOW_UP
|
||||
);
|
||||
return sortBy ? sort(followUpParticipants, sortBy) : followUpParticipants;
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user