当前位置: 首页>>代码示例>>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;未经允许,请勿转载。