feat: add view notifications page (#1170)

Fixes: #1169
This commit is contained in:
Karan Takalkar
2020-08-03 16:24:20 +05:30
committed by GitHub
parent ac280d2447
commit 30139026bd
11 changed files with 246 additions and 2 deletions
@@ -0,0 +1,29 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
/** rxjs Imports */
import { Observable } from 'rxjs';
/**
* Notification service.
*/
@Injectable({
providedIn: 'root'
})
export class NotificationsService {
/**
* @param {HttpClient} http Http Client to send requests.
*/
constructor(private http: HttpClient) { }
/**
* @returns {Observable<any>} Notifications.
*/
getNotifications(isRead: boolean): Observable<any> {
const httpParams = new HttpParams().set('isRead', isRead.toString());
return this.http.get('/notifications', { params: httpParams });
}
}