當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript axios.patch函數代碼示例

本文整理匯總了TypeScript中axios.patch函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript patch函數的具體用法?TypeScript patch怎麽用?TypeScript patch使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了patch函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: fromPromise

 patch<T = any>(
   url: string,
   data?,
   config?: AxiosRequestConfig,
 ): Observable<AxiosResponse<T>> {
   return fromPromise(axios.patch(url, data, config));
 }
開發者ID:a1r0,項目名稱:nest,代碼行數:7,代碼來源:http.service.ts

示例2: dispatch

export const applyGarden = (gardenId: number) => (dispatch: Function) => axios
  .patch<void>(API.current.applyGardenPath(gardenId))
  .then(() => {
    history.push("/app/designer/plants");
    dispatch(unselectSavedGarden);
    const busyToastTitle = t("Please wait");
    info(t("while your garden is applied."), busyToastTitle, "blue");
  });
開發者ID:RickCarlino,項目名稱:farmbot-web-app,代碼行數:8,代碼來源:actions.ts

示例3: patchItems

    /**
     * Update multiple entities but only the changed fields
     */
    async patchItems(entityTypeName: string, patchPairs: IPatchPair[]): Promise<any> {
        var entitySetName = this.metadataCli.entityTypes[entityTypeName].entitySetName;

        var url = this.apiUrl + "/crud/" + "batch/" + entitySetName;

        var response = await axios.patch(url, patchPairs.map((it) => it.patchItem));
        return response.data;
    }
開發者ID:marianc,項目名稱:node-server-typescript-client,代碼行數:11,代碼來源:dataAdapter.ts

示例4: return

 return (dispatch, getState) => {
     axios.patch<User>(API.current.usersPath, user)
         .then((resp) => {
             success(t("User successfully updated."));
             dispatch(updateUserSuccess(resp.data));
         }, (e: Error) => {
             error(t(`User could not be updated: ${e.message}`));
         });
 };
開發者ID:roryaronson,項目名稱:farmbot-web-frontend,代碼行數:9,代碼來源:actions.ts

示例5: mergeMap

 mergeMap((action: any) => {
   return axios
     .patch(makeApiUrl(`/task-card/${action.payload.id}`), {
       id: action.payload.id,
       status: 'ARCHIVE'
     })
     .then(() => Actions.ARCHIVE_TASK_CARD.success({ id: action.payload.id }))
     .catch(resp => Actions.ARCHIVE_TASK_CARD.failure(resp.data));
 })
開發者ID:A-Horse,項目名稱:bblist,代碼行數:9,代碼來源:task-card.epic.ts

示例6: it

    it('PATCH .patch', () => {
      const original = {
        description: 'PATCH .patch'
      };

      return axios.patch(`http://localhost:${port}/${name}/544`, original)
        .then(res => {
          assert.ok(res.status === 200, 'Got OK status code');
          verify.patch('544', original, res.data);
        });
    });
開發者ID:feathersjs,項目名稱:feathers,代碼行數:11,代碼來源:crud.ts

示例7: Promise

 return new Promise((resolve, reject) => {
     axios.patch(
         '/api/Calendars/' + id + '?authorization=' + authorization,
         {occurrences: occurrences}
     )
         .then((response) => {
             resolve(ensueCalendarHasOccurrences(response.data));
         })
         .catch(function (error) {
             reject(error);
         });
 });
開發者ID:rodmcnew,項目名稱:occurrence-calendar,代碼行數:12,代碼來源:calendarRepository.ts

示例8: patchItem

    /**
     * Update single entity but only the changed fields
     */
    async patchItem(entityTypeName: string, item: IPatchPair): Promise<any> {
        var entitySetName = this.metadataCli.entityTypes[entityTypeName].entitySetName,
            keyNames = this.metadataCli.entityTypes[entityTypeName].key;
        var queryObject: IQueryObject = {
            keys: [utils.getKeyFromData(keyNames, item.partialDto)]
        };

        var query = queryUtils.renderQueryString(queryObject);
        var url = this.apiUrl + "/crud/" + entitySetName + (query ? "?" + query : ""); //utils.getUrlKeyFromData(keyNames, item.partialDto);

        var response = await axios.patch(url, item.patchItem);
        return response.data;
    }
開發者ID:marianc,項目名稱:node-server-typescript-client,代碼行數:16,代碼來源:dataAdapter.ts


注:本文中的axios.patch函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。