Skip to content

Bug: Scope with function is not added correctly #70

Closed
@kingjerod

Description

@kingjerod

If you have a scope with a function like so:

@Scopes({
  something: function (id) {
    return {
      where: {id: id}
    }
  }
})

It doesn't get added properly to the Sequelize model. I was ready to open a PR to fix this, but I think it's beyond my knowledge of this module. The problem is in resolveScope in the lib/services/model file, it should check if the options is a function and if so, just add the scope. I'm not sure if there is something else that needs to be done to the function.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions