[Typescript] Type fix "SmartFieldFilterer" can return promise

Hello,

I noticed that SmartFieldFilterer does not allow in its current definition to return a promise instead of forest-express work well with promise:

actual:

export interface SmartFieldFilterer {
  (filter: SmartFieldFiltererFilter): Sequelize.WhereOptions
}

proposal:

export interface SmartFieldFilterer {
  (filter: SmartFieldFiltererFilter): Sequelize.WhereOptions | Promise<Sequelize.WhereOptions>;
}

PR:
https://github.com/ForestAdmin/forest-express-sequelize/pull/1043

Hello @Justin_Martin,

Thanks for your message :raised_hands:

We’ll check this quickly and come back to you.

Cheers.

Hey :wave:, and sorry for the delayed response on this one. (I initially thought that the filter operation didn’t have the async/await capability, but it seems like I was wrong. I still double checked it and it seems perfectly fine)

Thanks for your contribution, it should be available in the next forest-express-sequelize release :+1:

1 Like