refactor: 🏷️ Migliorata tipizzazione del model

This commit is contained in:
Maicol Battistini 2023-07-14 11:06:57 +02:00
parent ffdb0eeadc
commit 3c811c4c62
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,10 @@ export default abstract class Model<A extends ModelAttributes, R extends ModelRe
/**
* Returns all the instances of the model. (Alias of {@link Model.get}).
*/
static all<M extends Model<any, any>>(): Promise<PluralResponse<M>> {
static all<M extends typeof Model<any, any> & {
new (): M;
// @ts-ignore
}>(this: M): Promise<PluralResponse<M>> {
// @ts-expect-error
return this.get();
}