Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Injectable } from '@angular/core';
  2. import { HttpClient, HttpHeaders } from '@angular/common/http';
  3. import { Observable } from 'rxjs/Observable';
  4. import { APP_CONSTANTS } from '../app.constants';
  5. import 'rxjs/add/operator/map';
  6.  
  7. @Injectable()
  8. export class UserEventService {
  9.   constructor(private http: HttpClient) { }
  10.  
  11.   attend(location: string,
  12.   name: string,
  13.   description: string,
  14.   imageUrl: string,
  15.   eventType: string,
  16.   startTime: string,
  17.   endTime: string) {
  18.     const currentUser = JSON.parse(localStorage.getItem('currentUser'));
  19.     const userEmail = currentUser.username;
  20.     return this.http.post<any>(`${APP_CONSTANTS.USEREVENTS}/api/userslist/email/`+ userEmail, {userEmail: userEmail,
  21.       location: location,
  22.       name: name,
  23.       description: description,
  24.       imageUrl: imageUrl,
  25.       eventType: eventType,
  26.       startTime: startTime,
  27.       endTime: endTime });
  28.   }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement