Skip to content

Commit f2a40ec

Browse files
committed
fix(sequelize): add support for extended operators
fix loopbackio#10272 Signed-off-by: Yesha Mavani <[email protected]>
1 parent 937a6c1 commit f2a40ec

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

extensions/sequelize/src/__tests__/fixtures/controllers/roles.controller.ts

+2-17
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class RolesController extends TestControllerBase {
4040
return this.roleRepository.create(role);
4141
}
4242

43-
@get('/roles-desc')
43+
@get('/roles')
4444
@response(200, {
4545
description: 'Role model instance',
4646
content: {
@@ -49,22 +49,7 @@ export class RolesController extends TestControllerBase {
4949
},
5050
},
5151
})
52-
async getRolesByDesc(
53-
@param.filter(Roles) filter?: Filter<Roles>,
54-
): Promise<Roles[]> {
55-
return this.roleRepository.find(filter);
56-
}
57-
58-
@get('/roles-perm')
59-
@response(200, {
60-
description: 'Role model instance',
61-
content: {
62-
'application/json': {
63-
schema: getModelSchemaRef(Roles, {includeRelations: true}),
64-
},
65-
},
66-
})
67-
async getRolesByPermission(
52+
async getRoles(
6853
@param.filter(Roles) filter?: Filter<Roles>,
6954
): Promise<Roles[]> {
7055
return this.roleRepository.find(filter);

extensions/sequelize/src/__tests__/integration/repository.integration.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ describe('Sequelize CRUD Repository (integration)', () => {
10221022
} as AnyObject,
10231023
};
10241024
const roleByDesc = await client.get(
1025-
`/roles-desc?filter=${encodeURIComponent(JSON.stringify(filter))}`,
1025+
`/roles?filter=${encodeURIComponent(JSON.stringify(filter))}`,
10261026
);
10271027

10281028
expect(roleByDesc.body).to.have.properties(
@@ -1057,7 +1057,7 @@ describe('Sequelize CRUD Repository (integration)', () => {
10571057
},
10581058
} as AnyObject;
10591059
const roleByDesc = await client.get(
1060-
`/roles-perm?filter=${encodeURIComponent(JSON.stringify(filter))}`,
1060+
`/roles?filter=${encodeURIComponent(JSON.stringify(filter))}`,
10611061
);
10621062

10631063
expect(roleByDesc.body).to.have.properties(

0 commit comments

Comments
 (0)