getSearchResults(searchTerm) {
   return this.http.post(this.apiURL + 'searchResultsPage.json', {searchTerm});
 }
Ejemplo n.º 2
0
  public add<T>(itemName: string): Observable<T> {
    const toAdd = JSON.stringify({ ItemName: itemName });

    return this.http.post<T>(this.actionUrl, toAdd);
  }
Ejemplo n.º 3
0
 create(personId: number, command: ChargeCommand): Observable<ChargeModel> {
   return this.http.post<ChargeModel>(`/api/persons/${personId}/charges`, command);
 }
Ejemplo n.º 4
0
 signup(credentials: User): Observable<object> {
   return this.http.post('http://localhost:8080/api/users', credentials).pipe(
     mergeMap(res => this.login(credentials))
   );
 }
Ejemplo n.º 5
0
 addTask(name:string,desc:string){
   httpOptions.headers = httpOptions.headers.set('Authorization', window.localStorage['jwt']);
   return this.http.post(url+"task",JSON.stringify({name:name,description:desc}),httpOptions);
 }
 addHistory(atletaHistory: AtletaHistory) {
   atletaHistory.codigo = null;
     return this.http.post(`${LUF_API}/atletas/history-new`, atletaHistory);
 }
Ejemplo n.º 7
0
 create(personId: number, text: string): Observable<NoteModel> {
   const command = { text };
   return this.http.post<NoteModel>(`/api/persons/${personId}/notes`, command);
 }
Ejemplo n.º 8
0
	/**
	 * Duplicates and saves an existing playbook, it's workflows, actions, branches, etc. under a new name.
	 * @param playbookId ID of the playbook to duplicate
	 * @param newName Name of the new copy to be saved
	 */
	duplicatePlaybook(playbookId: string, newName: string): Promise<Playbook> {
		return this.http.post(`/api/playbooks?source=${playbookId}`, { name: newName })
			.toPromise()
			.then((data) => plainToClass(Playbook, data))
			.catch(this.utils.handleResponseError);
	}
Ejemplo n.º 9
0
 public escalate(alerts: Alert[]): Observable<Object | RestError> {
   return this.http.post('/api/v1/alerts/ui/escalate', alerts).pipe(
   catchError(HttpUtil.handleError));
 }
Ejemplo n.º 10
0
 public save(recipe: Recipe) {
   if (!recipe.id) {
     return this.http.post('/recipes', recipe);
   }
 }
Ejemplo n.º 11
0
	/**
	 * Saves a new playbook.
	 * @param playbook New playbook to be saved
	 */
	newPlaybook(playbook: Playbook): Promise<Playbook> {
		return this.http.post('/api/playbooks', playbook)
			.toPromise()
			.then((data) => plainToClass(Playbook, data))
			.catch(this.utils.handleResponseError);
	}
Ejemplo n.º 12
0
 add(item: any): Observable<any> {
   return this.http.post(Api.ITEMS_END_POINT, item);
 }
 save(keyAndPassword: any): Observable<any> {
     return this.http.post(SERVER_API_URL + 'api/account/reset-password/finish', keyAndPassword);
 }
 getSearchFilterResults(filter) {
   return this.http.post(this.apiURL + 'searchFilterResultsPage.json', {
    filter
   });
 }
Ejemplo n.º 15
0
 setOBSConnectionInformation(host, port) {
   return this.http.post('api/caption/connectionInfo', {
     host: host,
     port: port
   });
 }
 public getCatalog(id: string) {
     const endpoint = `${this._catalogUrl}/catalog/${id}`;
     return this.http.post<CatalogResponse>(endpoint, {})
         .toPromise()
         .catch(err => this._handleError(err));
 }
Ejemplo n.º 17
0
 post(url, data): Observable<Response> {
     return this.http.post(environment.base_url + url, data)
         .map((response: Response) => {
             return response.json();
         }).catch(this.handleError);
 }
 public addCatalog(model: CatalogRequest): Promise<CatalogResponse> {
     const endpoint = `${this._catalogUrl}/catalog`;
     return this.http.post<CatalogResponse>(endpoint, model, {})
         .toPromise()
         .catch(err => this._handleError(err));
 }
Ejemplo n.º 19
0
  supportOrUnSupport(id, i, indexOfStarsTarget, flag) {
    if (this.user === "") {
      return;
    }
    if (flag === 0) {
      this.httpClient.post(URL_path.class.supportThis, {
        userId: this.user._id,
        type: "support",
        starsTarget: starsTargets[indexOfStarsTarget],
        id: id
      }, {
          headers: jsonHeader
        }).toPromise().then((res: any) => {
          if (res.result === false) {
            if (res.state == 0) {
              let alert = this.alertCtrl.create({
                title: 'error',
                subTitle: res.des,
                buttons: ['OK', 'Cancel'],
              });
              alert.present().then(() => {
                return;
              });
            } else {
              //业务错误

              let alert = this.alertCtrl.create({
                title: 'Ops',
                subTitle: res.des+",unSupport it?",
                buttons: [
                  {
                    text: 'unSupport',
                    handler: () => {
                     //取消支持
                     this.supportOrUnSupport(id, i, indexOfStarsTarget, 1)
                    }
                  },
                  {
                    text: 'cancel',
                    handler: () => {
                      return ;
                    } 
                  }],
              });
              alert.present().then(() => {
                return;
              });
            }
          }else {
            //更改点赞数
           if(i<0) this.note.stars +=1;
           else  this.note.commentList[i].stars+=1;

          }
        }).catch((error: Error) => {
          let alert = this.alertCtrl.create({
            title: 'error',
            subTitle: error.message,
            buttons: ['OK', 'Cancel'],
          });
          alert.present().then(() => {
            return;
          });

        });
    } else {
      this.httpClient.post(URL_path.class.supportThis, {
        userId: this.user._id,
        type: "unSupport",
        starsTarget: starsTargets[indexOfStarsTarget],
        id: id
      }, {
          headers: jsonHeader
        }).toPromise().then((res: any) => {
          if (res.result === false) {
            if (res.state == 0) {
              //其他类型的的错误
              let alert = this.alertCtrl.create({
                title: 'error',
                subTitle: res.des,
                buttons: ['OK'],
              });
              alert.present().then(() => {
                return;
              });
            } else {
              //业务错误,取消点赞就没有办法了
              let alert = this.alertCtrl.create({
                title: 'Ops',
                subTitle: res.des,
                buttons: ['OK'],
              });
              alert.present().then(() => {
                return;
              });
            }
          }else {

            //更改点赞数
            if(i<0) this.note.stars -=1;
            else  this.note.commentList[i].stars-=1;

          }
        }).catch((error: Error) => {
          let alert = this.alertCtrl.create({
            title: 'error',
            subTitle: error.message,
            buttons: ['OK', 'Cancel'],
          });
          alert.present().then(() => {
            return;
          });

        });
    }


  }
Ejemplo n.º 20
0
 save(entity: T): Observable<T> {
     return this.http.post(this.resourceUrl, entity)
         .map((res: any) => res && res.data)
 }
Ejemplo n.º 21
0
 save(account: any): Observable<any> {
     return this.http.post(SERVER_API_URL + 'uaaserver/api/register', account);
 }
 addNewMessage(msg:PersonalisedMessage){
     return this.__http.post<string>("http://localhost:9090/api/mobileMessage",msg);
 }
Ejemplo n.º 23
0
 sign(email:string,pw:string) {
   return this.http.post(url+"sign",JSON.stringify({email:email,password:pw}),httpOptions);
 }
Ejemplo n.º 24
0
 createByPath(folderPath: string): Observable<IFolderDto> {
   return this.http.post<IFolderDto>(`${AppConfig.serverBaseUrl}/folder/byPath`, { path: folderPath });
 }
Ejemplo n.º 25
0
 save(mail: string): Observable<any> {
     return this.http.post(SERVER_API_URL + 'uaaserver/api/account/reset-password/init', mail);
 }
Ejemplo n.º 26
0
 setAreaPosition(areaPosition) {
   return this.http.post('api/caption/areaPosition', areaPosition);
 }
Ejemplo n.º 27
0
 postTipologia(dados) {
   return this.http
     .post<Tipologia>(`${GESAC_API}tipologia`, dados.value)
     .catch(this.appService.handleError);
 }
Ejemplo n.º 28
0
 setCustomCSS(cssStyle) {
   return this.http.post('api/caption/customCSS', { cssStyle: cssStyle });
 }
Ejemplo n.º 29
0
			return Observable.create((observer) => {
				this.http.post("http://localhost:8080/login", formData).subscribe((data: IUserToken) => {
					this.setUserToken(data);
					observer.next({success: this.getUserToken()});
				});
			});
Ejemplo n.º 30
0
 getLongestPathSumRootToLeaf(arr: number[]) {
   const endpoint = '/api/binary-tree/longest-path-sum-root-to-leaf';
   return this.http.post<any>(endpoint, {intData: arr})
 }