Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Injectable } from '@angular/core';
- import { HttpService } from "../services/http.service";
- import { Constants } from '../pages/constants';
- import { Observable } from 'rxjs';
- @Injectable()
- export class UsuarioProvider {
- constructor(private http: HttpService) {}
- alterarIndicadorNotificacao(idUsuario, indNotificacao): Observable<any> {
- return this.http.put(`${Constants.API_ENDPOINT}/usuario/${idUsuario}/notificacao`, {
- ind_notificacao: indNotificacao
- });
- }
- alterarSenha(idUsuario, senhaAtual, novaSenha): Observable<any> {
- return this.http.put(`${Constants.API_ENDPOINT}/usuario/${idUsuario}/alterarsenha`, {
- senha_atual: senhaAtual,
- nova_senha: novaSenha
- });
- }
- alterarEmail(idUsuario, senhaAtual, novoEmail): Observable<any> {
- return this.http.put(`${Constants.API_ENDPOINT}/usuario/${idUsuario}/email`, {
- novo_email: novoEmail,
- senha_atual: senhaAtual
- });
- }
- emailExiste(email): Observable<any> {
- return this.http.get(`${Constants.API_ENDPOINT}/usuario/email/${email}`);
- }
- facebookIdExiste(id): Observable<any> {
- return this.http.get(`${Constants.API_ENDPOINT}/usuario/facebook/${id}`);
- }
- autenticar(email: string, senha: string): Observable<any> {
- return this.http.post(`${Constants.API_ENDPOINT}/autenticar`, {email, senha});
- }
- autenticarToken(email: string, fb_id: string | number, fb_token: string, uuid?: string): Observable<any> {
- return this.http.post(`${Constants.API_ENDPOINT}/autenticar/facebook`, {email, fb_id, fb_token, uuid});
- }
- cadastrar(dados): Observable<any> {
- return this.http.post(`${Constants.API_ENDPOINT}/usuario`, dados);
- }
- convidarAmigo(nome, email): Observable<any> {
- return this.http.post(`${Constants.API_ENDPOINT}/usuario/convidar-amigo`, {nome, email});
- }
- buscarNotificacoes() {
- return this.http.get(`${Constants.API_ENDPOINT}/notificacao`);
- }
- buscarTotalNotificacoes() {
- return this.http.get(`${Constants.API_ENDPOINT}/notificacao/total`);
- }
- atualizarNotificacoes(data) {
- return this.http.put(`${Constants.API_ENDPOINT}/notificacao`, {data});
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement