Skip to content

Commit

Permalink
fix(sequelize): add support for extended operators
Browse files Browse the repository at this point in the history
fix #10272

Signed-off-by: Yesha Mavani <yesha.mavani@sourcefuse.com>
  • Loading branch information
yeshamavani authored and samarpanB committed Jan 18, 2024
1 parent dada287 commit 521c732
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class RolesController extends TestControllerBase {
return this.roleRepository.create(role);
}

@get('/roles-desc')
@get('/roles')
@response(200, {
description: 'Role model instance',
content: {
Expand All @@ -49,22 +49,7 @@ export class RolesController extends TestControllerBase {
},
},
})
async getRolesByDesc(
@param.filter(Roles) filter?: Filter<Roles>,
): Promise<Roles[]> {
return this.roleRepository.find(filter);
}

@get('/roles-perm')
@response(200, {
description: 'Role model instance',
content: {
'application/json': {
schema: getModelSchemaRef(Roles, {includeRelations: true}),
},
},
})
async getRolesByPermission(
async getRoles(
@param.filter(Roles) filter?: Filter<Roles>,
): Promise<Roles[]> {
return this.roleRepository.find(filter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ describe('Sequelize CRUD Repository (integration)', () => {
} as AnyObject,
};
const roleByDesc = await client.get(
`/roles-desc?filter=${encodeURIComponent(JSON.stringify(filter))}`,
`/roles?filter=${encodeURIComponent(JSON.stringify(filter))}`,
);

expect(roleByDesc.body).to.have.properties(
Expand Down Expand Up @@ -1124,7 +1124,7 @@ describe('Sequelize CRUD Repository (integration)', () => {
},
} as AnyObject;
const roleByDesc = await client.get(
`/roles-perm?filter=${encodeURIComponent(JSON.stringify(filter))}`,
`/roles?filter=${encodeURIComponent(JSON.stringify(filter))}`,
);

expect(roleByDesc.body).to.have.properties(
Expand Down

0 comments on commit 521c732

Please sign in to comment.