Releases: nicgirault/express-crud-router
Releases · nicgirault/express-crud-router
v5.2.0
v5.1.2
v5.1.1
v5.1.0
v5.0.0
v4.0.2
v4.0.1
v4.0.0
4.0.0 (2020-05-15)
Bug Fixes
- upgrade express dependencies (35b465d)
Features
- ✨ adding "%" in a filter will now use iLike instead of like (9fb5cff)
- ✨ adding "%" in a filter will now use iLike instead of like (1d33256)
- add breaking details (d544906)
BREAKING CHANGES
- The options totally changed. Hooks are removed. now the options look like:
crud('/admin/users', User, {
getList: (filter, limit, offset, order) =>
User.findAllAndCount({ limit, offset, order, where: filter }),
search: (q, findOptions) => User.findAllAndCount({...findOptions, where: {name: {[Op.ilike]: "${q}%"}}}),
getOne: id => User.findByPk(id),
create: body => User.create(body),
update: (body, id) => User.update(body, { where: { id } }),
delete: id => User.delete({ where: { id } }),
})