Changeset 6738cc0 for src/Clients/Angular/finki-chattery/src/app/shared-app/services/base-api.service.ts
Legend:
- Unmodified
- Added
- Removed
-
src/Clients/Angular/finki-chattery/src/app/shared-app/services/base-api.service.ts
rf3c4950 r6738cc0 4 4 5 5 import { environment } from '@env/environment'; 6 import { SelfUserResponse } from '../models'; 6 import { SelfUserResponse, StudentNotificationResponse } from '../models'; 7 import { map } from 'rxjs/operators'; 8 import * as moment from 'moment'; 7 9 8 10 @Injectable({ … … 19 21 20 22 public getSelfUser(): Observable<SelfUserResponse> { 21 return this.get<SelfUserResponse>('v1/self'); 23 return this.get<SelfUserResponse>('v1/self').pipe( 24 map((x) => { 25 if (x.student) { 26 x.student.notifications = x.student.notifications.map( 27 (y) => new StudentNotificationResponse(y.uid, moment(y.createdOn), y.questionUid, y.text) 28 ); 29 } 30 31 return x; 32 }) 33 ); 22 34 } 23 35
Note:
See TracChangeset
for help on using the changeset viewer.