Skip to content

Commit 4b7b21d

Browse files
committed
Fix typescript compilation errors
Errors were: ``` Type 'CollectionProxy<{}>' is not assignable to type 'CollectionProxy<Model>'. Type 'RecordProxy<{}>' is not assignable to type 'RecordProxy<Model>'. ```
1 parent bef6279 commit 4b7b21d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ node_modules
44

55
lib
66
lib-esm
7-
_bundles
7+
_bundles
8+
yarn.lock

src/scope.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ export default class Scope {
2626

2727
all() : Promise<CollectionProxy<Model>> {
2828
return this._fetch(this.model.url()).then((json : japiDoc) => {
29-
let collection = new CollectionProxy(json);
29+
let collection = new CollectionProxy<Model>(json);
3030
return collection;
3131
});
3232
}
3333

3434
find(id : string | number) : Promise<RecordProxy<Model>> {
3535
return this._fetch(this.model.url(id)).then((json : japiDoc) => {
36-
return new RecordProxy(json)
36+
return new RecordProxy<Model>(json);
3737
});
3838
}
3939

4040
first() : Promise<RecordProxy<Model>> {
4141
let newScope = this.per(1);
4242
return newScope._fetch(newScope.model.url()).then((json : japiDoc) => {
4343
json.data = json.data[0];
44-
return new RecordProxy(json);
44+
return new RecordProxy<Model>(json);
4545
});
4646
}
4747

0 commit comments

Comments
 (0)