import { Injectable } from '@angular/core'; import { HttpWrapperService } from './http-wrapper.service'; import { ApiResult } from '../resources/utility_models/api_result'; import { User, ContactPreferences, EmailAuditFilter, EmailAudit, TournamentAvailabilitySummary } from 'tournee.businesslogic'; @Injectable() export class UserProfileService { constructor(private http: HttpWrapperService) {} update_basic(user : User) { return this.http.securePut>('/user/profile/basic', user.save_object()); } get_contact_preferences() { return this.http.secureGet>('/user/profile/contactpreferences'); } update_marketing_contact_preferences(new_value: boolean) { return this.http.securePut>('/user/profile/contactpreferences/marketing/' + new_value); } update_tournamentalerts_contact_preferences(new_value: boolean) { return this.http.securePut>('/user/profile/contactpreferences/tournamentalerts/' + new_value); } associate_user_with_game_system(game_system_id) { return this.http.securePut('/user/profile/gamesystems/' + game_system_id, null); } dis_associate_user_with_game_system(game_system_id) { return this.http.secureDelete('/user/profile/gamesystems/' + game_system_id); } my_emails(filter: EmailAuditFilter) { return this.http.secureGet>>('/user/profile/myemails/' + filter.send_object()); } renew_gdpr() { return this.http.securePut>('/user/profile/renewgdpr'); } save_tournament(tournament_id: string) { return this.http.securePut>('/user/profile/save/tournaments/' + tournament_id); } get_saved_tournaments() { return this.http.secureGet>>('/user/profile/save/tournaments'); } }