Hi there,
I'm using Nuxt 3, and I'm getting a Typescript warning when apply new "orderings" param yo my requests.
As far as I know, orderings was like this:
{
orderings: '[my.post.date desc]'
}
But now it's an array:
{
orderings: [
{ field: 'my.post.date', direction: 'desc' }
]
}
Well, I'm gettings this warning from Typescript:
Argument of type '{ fetchLinks: string; lang: "es-ES" | "en-EU"; orderings: { field: string; direction: string; }[]; page: number; pageSize: any; filters: any[]; }' is not assignable to parameter of type 'Partial<BuildQueryURLArgs> & FetchParams'.
Type '{ fetchLinks: string; lang: "es-ES" | "en-EU"; orderings: { field: string; direction: string; }[]; page: number; pageSize: any; filters: any[]; }' is not assignable to type 'Partial<BuildQueryURLArgs>'.
Types of property 'orderings' are incompatible.
Type '{ field: string; direction: string; }[]' is not assignable to type 'string | Ordering | (string | Ordering)[] | undefined'.
Type '{ field: string; direction: string; }[]' is not assignable to type '(string | Ordering)[]'.
Type '{ field: string; direction: string; }' is not assignable to type 'string | Ordering'.
Type '{ field: string; direction: string; }' is not assignable to type 'Ordering'.
Types of property 'direction' are incompatible.
Type 'string' is not assignable to type '"desc" | "asc" | undefined'.ts-plugin(2345)
const postsParams: {
fetchLinks: string;
lang: "es-ES" | "en-EU";
orderings: {
field: string;
direction: string;
}[];
page: number;
pageSize: any;
filters: any[];
}
Looks like some type is not updated, right?
Thank you.