【发布时间】:2021-08-11 16:15:38
【问题描述】:
我正在尝试使用 react guery 从这个函数中获取一些 sata。
export const quotaReservationRefundServiceBankAccount = (
id: string,
bankAccountInformation: IBankAccountInformation,
quotaLegal?: string,
): Promise<Response> => {
const url = `${appSettings.bffUrl}/api/pregnancies/quotareservations/${id}/bankaccount/refund`;
const body: IRefundQuotaReservationRequest = {
language: appSettings.language,
bankAccountInformation,
legalDepartmentShortCode: quotaLegal || "",
};
return post(url, body);
};
我得到了这个票价:
const { data: testData, isLoading, error } = useQuery<string, IBankAccountInformation, string | undefined>(["bankRefundResponse", quota?.reservation || "Quota.reservation missing", bankAccountInfo, quota.legal], quotaReservationRefundServiceBankAccount, {
});
Typescript 给了我这个错误:
'(id: string, bankAccountInformation: IBankAccountInformation, quotaLegal?: 字符串 |未定义)=> Promise' 不可分配给类型参数 'QueryFunction
'.ts(2345)
【问题讨论】: