本文整理汇总了TypeScript中src/services.setData函数的典型用法代码示例。如果您正苦于以下问题:TypeScript setData函数的具体用法?TypeScript setData怎么用?TypeScript setData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setData函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: 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
示例2: 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
示例3: setURL
export const updateUser = (username: string, data: Partial<User>) =>
Request<User>(
setURL(`${API_ROOT}/account/users/${username}`),
setMethod('PUT'),
setData(data, UpdateUserSchema),
)
.then(response => response.data);
开发者ID:displague,项目名称:manager,代码行数:7,代码来源:users.ts
示例4: setURL
export const makePayment = (data: { usd: string, cvv?: string }) =>
Request<Linode.Payment>(
setURL(`${API_ROOT}/account/payments`),
setMethod('POST'),
setData(data, PaymentSchema),
)
.then(response => response.data)
开发者ID:displague,项目名称:manager,代码行数:7,代码来源:payments.ts
示例5: 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
注:本文中的src/services.setData函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论