Skip to content

Commit

Permalink
fix(knex): The method getModel in the knex adapter (#3043)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-bach authored Feb 7, 2023
1 parent 5380a5c commit 77e14dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/knex/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class KnexAdapter<
return this.getModel()
}

getModel(params?: ServiceParams) {
getModel(params: ServiceParams = {} as ServiceParams) {
const { Model } = this.getOptions(params)
return Model
}
Expand Down
7 changes: 7 additions & 0 deletions packages/knex/test/overrides.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,11 @@ describe('Feathers Knex Overridden Method With Self-Join', () => {

assert.strictEqual(patchedAnimal.name, newName)
})

it('get the service model (getModel)', async () => {
const model = animalService.Model
const options = animalService.options

assert.strictEqual(model, options.Model)
})
})

0 comments on commit 77e14dd

Please sign in to comment.