Ignore:
Timestamp:
01/19/22 19:14:27 (3 years ago)
Author:
Стојков Марко <mst@…>
Branches:
dev
Parents:
f3c4950
Message:

Added notifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Clients/Angular/finki-chattery/src/app/shared-app/services/base-api.service.ts

    rf3c4950 r6738cc0  
    44
    55import { environment } from '@env/environment';
    6 import { SelfUserResponse } from '../models';
     6import { SelfUserResponse, StudentNotificationResponse } from '../models';
     7import { map } from 'rxjs/operators';
     8import * as moment from 'moment';
    79
    810@Injectable({
     
    1921
    2022  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    );
    2234  }
    2335
Note: See TracChangeset for help on using the changeset viewer.