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
Ive just switched from 1.7.2 -> 1.9.0 and have started getting the following from useRepo()
No overload matches this call.
Overload 1 of 2, '(repository: Repository<Model> | Constructor<Repository<Model>>, pinia?: Pinia | undefined): Repository<Model>', gave the following error.
Argument of type 'typeof ClientRepo' is not assignable to parameter of type 'Repository<Model> | Constructor<Repository<Model>>'.
Type 'typeof ClientRepo' is not assignable to type 'Constructor<Repository<Model>>'.
Construct signature return types 'ClientRepo' and 'Repository<Model>' are incompatible.
The types of 'query().wheres' are incompatible between these types.
Type 'Where<ClientModel>[]' is not assignable to type 'Where<Model>[]'.
Type 'Where<ClientModel>' is not assignable to type 'Where<Model>'.
Types of property 'field' are incompatible.
Type 'string | string[] | WherePrimaryClosure<ClientModel> | undefined' is not assignable to type 'string | string[] | WherePrimaryClosure<Model> | undefined'.
Type 'WherePrimaryClosure<ClientModel>' is not assignable to type 'string | string[] | WherePrimaryClosure<Model> | undefined'.
Type 'WherePrimaryClosure<ClientModel>' is not assignable to type 'WherePrimaryClosure<Model>'.
Type 'Model' is not assignable to type 'ClientModel'.
Overload 2 of 2, '(model: Constructor<Model>, pinia?: Pinia | undefined): Repository<Model>', gave the following error.
Argument of type 'typeof ClientRepo' is not assignable to parameter of type 'Constructor<Model>'.
Type 'ClientRepo' is missing the following properties from type 'Model': _meta, $entity, $config, $namespace, and 39 more.ts-plugin(2769)
seems that after the update custom Repository<Client (extending Model)> to Repository<Model> are no longer equal types?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey guys any help would be appreciated. Sorry if this has been asked already, i couldn't find anyone with the same issue.
Using
I have the following simple model
Which has a fairly simple custom repo
which is then called somewhere
Ive just switched from 1.7.2 -> 1.9.0 and have started getting the following from
useRepo()seems that after the update custom Repository<Client (extending Model)> to Repository<Model> are no longer equal types?
If i change
to
the problem seems to go away, however then i lose type safety for the return types.
All reactions