getScript(scriptId: number) {
   return this.http.get<Script>(`${InteractiveExplorerConfig.API_URL}/scripts/${scriptId}`);
 }
 // Uses Observable.forkJoin() to run multiple concurrent http.get() requests.
 // The entire operation will result in an error state if any single request fails.
 getBooksAndMovies() {
     return Observable.forkJoin(
     this.http.get('/api/books'),
     this.http.get('/api/movies')
     );
 }
 // send a PUT request to the API to update a data object
 updateFood(food) {
     let body = JSON.stringify(food);
     return this.http.put('/api/food/' + food.id, body, httpOptions);
 }
 // This get-by-id will 404 when id not found
 getHero(id: number): Observable<Hero> {
   const url = `${this.heroesUrl}/${id}`;
   return this.http.get<Hero>(url).pipe(
     catchError(this.handleError)
   );
 }
 findAll(): Observable<GatewayRoute[]> {
     return this.http.get<GatewayRoute[]>(SERVER_API_URL + 'api/gateway/routes/');
 }
Example #6
0
 postNewContact(contactData: Contact): Observable<Contact> {
   return this.http.post<Contact>(`${environment.backend}/api/contact/`, contactData);
 }
Example #7
0
 public create(user: User): Observable<User> {
   return this.httpClient.post<User>("/api/users", user, {
     headers: { "Authorization": "Bearer " + localStorage.getItem("access_token") }
   });
 }
Example #8
0
 deleteLetters(id) {
   return this._http.delete(`https://test-api.javascript.ru/v1/ssumatokhin/letters/${id}`, { responseType: 'text' });
 }
Example #9
0
 getLetter(id) {
   return this._http.get(`https://test-api.javascript.ru/v1/ssumatokhin/letters/${id}`);
 }
 runFunction(parameters: RunScript) {
   return this.http.post<RunResult>(`${InteractiveExplorerConfig.API_URL}/scripts/${parameters.id}`, parameters);
 }
Example #11
0
 sendLetter(params) {
   return this._http.post('https://test-api.javascript.ru/v1/ssumatokhin/letters', params);
 }
 deleteScript(scriptId: number) {
   return this.http.delete(`${InteractiveExplorerConfig.API_URL}/scripts/${scriptId}`).pipe(
     map(() => scriptId),
   );
 }
 updateScript(script: UpdateScriptPayload) {
   return this.http.put<Script>(`${InteractiveExplorerConfig.API_URL}/scripts/${script.id}`, script);
 }
 createScript(script: NewScript) {
   return this.http.post<Script>(`${InteractiveExplorerConfig.API_URL}/scripts`, script);
 }
 login(loginData) {
     let url = this.environmentService.setAuthService('oauth/token');
     return this._http.post(url, loginData)
         .map(res => res)
         .catch(this.handleError);
 }
Example #16
0
 get lettersList() {
   return this._http.get('https://test-api.javascript.ru/v1/ssumatokhin/letters');
 }
 getMe() {
     let url = this.environmentService.setApiService('me');
     return this._http.get(url)
         .map(res => res)
         .catch(this.handleError);
 }
Example #18
0
 deleteFile(dataSetId: string, name: string): Observable<any> {
     return this.http.delete(FileManagerService.getUploadsUrl(dataSetId, name));
 }
Example #19
0
 public retrieve(offset: number = 0, length: number = 20): Observable<User[]> {
   return this.httpClient.get<User[]>("/api/users?offset=" + offset + "&length=" + length, {
     headers: { "Authorization": "Bearer " + localStorage.getItem("access_token") }
   });
 }
Example #20
0
 listFiles(dataSetId: string): Observable<DataSetFile[]> {
     return this.http.get<DataSetFile[]>(FileManagerService.getUploadsUrl(dataSetId));
 }
 getHeroes (): Observable<Hero[]> {
   return this.http.get<Hero[]>(this.heroesUrl).pipe(
  // tap(data => console.log(data)), // eyeball results in the console
     catchError(this.handleError)
   );
 }
Example #22
0
 getAllTemplates():Observable<Template[]>{
     return this.__http.get<Template[]>("http://localhost:8080/templates");
 }
 updateHero (hero: Hero): Observable<null | Hero> {
   return this.http.put<Hero>(this.heroesUrl, hero, cudOptions).pipe(
     catchError(this.handleError)
   );
 }
Example #24
0
 getSingleTemplate(templateId:number):Observable<Template>{
     return this.__http.get<Template>("http://localhost:8080/templates"+templateId);
 }
    // NOTE: all API calls in this file use simple endpoints served by
    // an Express app in the file app.js in the repo root. See that file
    // for all back-end code.

    // Uses http.get() to load data from a single API endpoint
    getAccounts() {
        return this.http.get('http://localhost:8080/getAccounts');
    }
Example #26
0
 updateTemplate(template:Template){
     return this.__http.post<string>("http://localhost:8080/templates",template);
 }
 // send a POST request to the API to create a new data object
 createAccount(account) {
     let body = JSON.stringify(account);
     console.log("the body is " + body);
     return this.http.post('http://localhost:8080/register/', body, httpOptions);
 }
Example #28
0
 goToHome(){
     return this.__http.get("http://localhost:8080/templates");
 }
 // send a DELETE request to the API to delete a data object
 deleteAccount(account) {
     return this.http.delete('/api/food/' + account.email);
 }
 getScripts() {
   return this.http.get<Script[]>(InteractiveExplorerConfig.API_URL + '/scripts');
 }