Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 9cc55d8d

Přidáno uživatelem Václav Jirák před téměř 6 roky(ů)

Re #7534 'Profile settings' component connected to the API

Zobrazit rozdíly:

webapp/src/app/services/api/user.service.ts
5 5
import {BasicService} from './basic.service';
6 6
import {catchError} from 'rxjs/operators';
7 7
import {Languages, RequestStatus, RequestTypes} from '../../enums/common.enum';
8
import {UserSettings} from '../../models/settings.model';
8
import {NotificationSettings, UserSettings} from '../../models/settings.model';
9 9
import {UserProfile} from '../../models/user.model';
10 10
import {UserRequest} from '../../models/requests.model';
11 11
import {MatSnackBar} from '@angular/material';
......
126 126
    return this.makePutUserSettingsApiCall(settings, language);
127 127
  }
128 128

  
129
  putNotificationSettingsWithLanguage(settings: NotificationSettings, language: Languages) {
130
    console.log(settings);
131
    return this.makePutNotificationSettingsApiCall(settings, language);
132
  }
129 133
  /**
130 134
   * Accept or deny user request
131 135
   * @param request request to accept or deny
......
237 241
      );
238 242
  }
239 243

  
244
  /**
245
   * Změna nastavení notifikace uživatele podle id
246
   * PUT /user/settings?[lang=<CZ,EN>]
247
   * @param settings notification setting to be set for given user
248
   * @param language specified language
249
   */
250
  private makePutNotificationSettingsApiCall(settings: NotificationSettings, language: Languages) {
251
    const httpParams: HttpParams = this.createParams({lang: language});
252
    const options = {params: httpParams};
253

  
254
    return this.http.put<NotificationSettings>(this._userUrl + 'settings', settings, options)
255
      .pipe(
256
        catchError(err => this.handleError(err))
257
      );
258
  }
259

  
240 260
  /**
241 261
   * Vytvoření nové dovolené nebo sick day
242 262
   * POST /user/calendar/create?[lang=<CZ,EN>]

Také k dispozici: Unified diff