mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
31 lines
769 B
TypeScript
31 lines
769 B
TypeScript
|
|
import { Injectable } from '@angular/core';
|
||
|
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||
|
|
import { environment } from 'src/environments/environment';
|
||
|
|
import { Token } from '../models/token.model';
|
||
|
|
|
||
|
|
@Injectable({
|
||
|
|
providedIn: 'root'
|
||
|
|
})
|
||
|
|
export class NotificationsService {
|
||
|
|
|
||
|
|
constructor(private http: HttpClient,) { }
|
||
|
|
|
||
|
|
getTokenByUserIdAndId(user, userID) {
|
||
|
|
const geturl = environment.apiURL + 'notifications/user/' + userID;
|
||
|
|
|
||
|
|
return this.http.get<Token[]>(`${geturl}`);
|
||
|
|
}
|
||
|
|
|
||
|
|
postToken(userId, token) {
|
||
|
|
const geturl = environment.apiURL + 'notifications/token';
|
||
|
|
|
||
|
|
let data = {
|
||
|
|
UserId: userId,
|
||
|
|
TokenId: token,
|
||
|
|
Status: 1,
|
||
|
|
Service: 2
|
||
|
|
}
|
||
|
|
return this.http.post<Token[]>(`${geturl}`,data);
|
||
|
|
}
|
||
|
|
}
|