当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript services.setMethod函数代码示例

本文整理汇总了TypeScript中src/services.setMethod函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setMethod函数的具体用法?TypeScript setMethod怎么用?TypeScript setMethod使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setMethod函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: setURL

export const getUsers = (params?: any, filters?: any) =>
  Request<Page<User>>(
    setURL(`${API_ROOT}/account/users`),
    setMethod('GET'),
    setParams(params),
    setXFilter(filters)
  ).then(response => response.data);
开发者ID:linode,项目名称:manager,代码行数:7,代码来源:users.ts

示例2: setURL

export const getImages = (params: any = {}, filters: any = {}) =>
  Request<Page<Image>>(
    setURL(`${API_ROOT}/images`),
    setMethod('GET'),
    setParams(params),
    setXFilter(filters)
  ).then(response => response.data);
开发者ID:linode,项目名称:manager,代码行数:7,代码来源:images.ts

示例3: setURL

export const updateAccountSettings = (data: Partial<Linode.AccountSettings>) =>
Request<Linode.AccountSettings>(
  setURL(`${API_ROOT}/account/settings`),
  setMethod('PUT'),
  setData(data, UpdateAccountSettingsSchema)
)
.then(response => response.data);
开发者ID:displague,项目名称:manager,代码行数:7,代码来源:account.ts

示例4: setURL

export const createUser = (data: Partial<User>) =>
  Request<User>(
    setURL(`${API_ROOT}/account/users`),
    setMethod('POST'),
    setData(data, CreateUserSchema),
  )
    .then(response => response.data);
开发者ID:displague,项目名称:manager,代码行数:7,代码来源:users.ts

示例5: setURL

export const updateOAuthClient = (clientId: number, data: Partial<OAuthClientRequest>) =>
  Request<OAuthClient>(
    setURL(`${API_ROOT}/account/oauth-clients/${clientId}`),
    setMethod('PUT'),
    setData(data, updateOAuthClientSchema),
  )
    .then(response => response.data);
开发者ID:displague,项目名称:manager,代码行数:7,代码来源:oauth.ts

示例6: setURL

export const makePayment = (data: { usd: string; cvv?: string }) => {
  /**
   * in the context of APIv4, CVV is optional - in other words, it's totally
   * valid to submit a payment without a CVV
   *
   * BUT if CVV is included in the payload, APIv4 will send an error that CVV must
   * have 3-4 characters.
   *
   * So for example this payload will result in an error
   *
   * {
   *   usd: 5,
   *   cvv: ''
   * }
   *
   * but this is good
   *
   * {
   *   usd: 5
   * }
   */
  if (!data.cvv) {
    delete data.cvv;
  }

  return Request<Linode.Payment>(
    setURL(`${API_ROOT}/account/payments`),
    setMethod('POST'),
    setData(data, PaymentSchema)
  ).then(response => response.data);
};
开发者ID:linode,项目名称:manager,代码行数:31,代码来源:payments.ts


注:本文中的src/services.setMethod函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。