From af5e743b01f20f24d0c25e786d57f557b21f3a24 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 6 Apr 2017 21:21:03 +0200 Subject: Client: add ability for user to change nsfw settings --- client/src/app/shared/users/user.service.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts index 865e04d48..0d41b900d 100644 --- a/client/src/app/shared/users/user.service.ts +++ b/client/src/app/shared/users/user.service.ts @@ -33,4 +33,12 @@ export class UserService { .map(this.restExtractor.extractDataBool) .catch((res) => this.restExtractor.handleError(res)); } + + updateDetails(details: { displayNSFW: boolean }) { + const url = UserService.BASE_USERS_URL + this.authService.getUser().id; + + return this.authHttp.put(url, details) + .map(this.restExtractor.extractDataBool) + .catch((res) => this.restExtractor.handleError(res)); + } } -- cgit v1.2.3