d88m_andy
d88m_andy
NNuxt
Created by d88m_andy on 8/13/2024 in #❓・help
[Q] useFetch's transform option + typescript
And the error was:
Type '(company: Company) => CompanyTransformed' is not assignable to type '_Transform<CompanyTransformed, CompanyTransformed>'.
Types of parameters 'company' and 'input' are incompatible.
Type 'CompanyTransformed' is not assignable to type 'Company'.
Types of property 'employees' are incompatible.
Type '(company: Company) => CompanyTransformed' is not assignable to type '_Transform<CompanyTransformed, CompanyTransformed>'.
Types of parameters 'company' and 'input' are incompatible.
Type 'CompanyTransformed' is not assignable to type 'Company'.
Types of property 'employees' are incompatible.
If it matters, useApi is just a wrapper from here https://nuxt.com/docs/guide/recipes/custom-usefetch#custom-usefetchuseasyncdata
2 replies