You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importclientfrom"./driver";exportinterfaceCourse{id?: number;name: string;description: string;price: number;image: string;}exportinterfaceUpdateCourse{name?: string;description?: string;price?: number;image?: string;}exportconstupdateCourse=async(id: number,course: UpdateCourse)=>{// Get list of non-null keysconstkeys=Object.keys(course).filter((key)=>course[keyaskeyofUpdateCourse]// If this is not null);constres=awaitclient<Course[]>`UPDATE courses SET ${client(course,keys)} WHERE id = ${id} RETURNING *`;};
Error:
No overload matches this call.
Argument of type '[string[]]' is not assignable to parameter of type 'readonly ("name" | "description" | "price" | "image")[] | [readonly ("name" | "description" | "price" | "image")[]]'.
Type '[string[]]' is not assignable to type '[readonly ("name" | "description" | "price" | "image")[]]'.
Type 'string[]' is not assignable to type 'readonly ("name" | "description" | "price" | "image")[]'.
Type 'string' is not assignable to type '"name" | "description" | "price" | "image"'.
Overload 2 of 2, '(template: TemplateStringsArray, ...parameters: readonly ParameterOrFragment<never>[]): PendingQuery<any>', gave the following error.
Argument of type 'UpdateCourse' is not assignable to parameter of type 'TemplateStringsArray'.
Type 'UpdateCourse' is missing the following properties from type 'TemplateStringsArray': raw, length, concat, join, and 27 more.
The function does work, but ts it's returning an error either way.
I'm using version 3.4.4
The text was updated successfully, but these errors were encountered:
The following snippet is generating an error:
Error:
The function does work, but ts it's returning an error either way.
I'm using version
3.4.4
The text was updated successfully, but these errors were encountered: