From 85aafc11ba1f056649f91881bcd1887157776d26 Mon Sep 17 00:00:00 2001 From: Art Date: Sun, 12 Sep 2021 21:41:24 +0300 Subject: [PATCH] 114. Add users to local cache (#13) --- support-portal-frontend/src/app/service/user.service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/support-portal-frontend/src/app/service/user.service.ts b/support-portal-frontend/src/app/service/user.service.ts index 2f0c1c6..5eb195f 100644 --- a/support-portal-frontend/src/app/service/user.service.ts +++ b/support-portal-frontend/src/app/service/user.service.ts @@ -10,6 +10,7 @@ import {User} from "../model/user"; export class UserService { private host: string = environment.apiUrl; + private storage = localStorage; constructor(private httpClient: HttpClient) { } @@ -49,6 +50,10 @@ export class UserService { .delete(`${this.host}/user/${userId}`); } + public addUsersToLocalStorage(users: User[]) { + this.storage.setItem('users', JSON.stringify(users)); + } + } export interface UserPage {