Skip to content

Commit

Permalink
Updated zone user repository
Browse files Browse the repository at this point in the history
Signed-off-by: Balaji <[email protected]>
  • Loading branch information
balaji-alluru committed Jan 16, 2024
1 parent 9434d0b commit 5e76bf9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ public interface ZoneUserRepository extends BaseRepository<ZoneUser, String> {
@Query("FROM ZoneUser zu WHERE LOWER(zu.userId)=LOWER(?1) and zu.isActive=true and (zu.isDeleted IS NULL OR zu.isDeleted = false) ")
public ZoneUser findZoneByUserIdActiveAndNonDeleted(String userId);

@Query("FROM ZoneUser zu WHERE LOWER(zu.zoneCode) like (%?1%) and (zu.isDeleted IS NULL OR zu.isDeleted = false) ")
/*
* This is a query used by a deprecated end point /users/search, this should be removed in next release.
* The end point using this query was added in version 1.2.0-rc1 and marked as deprecated in version 1.2.0
* For security reason, we replaced the 'LIKE' query with equals in where clause.
*/

@Query("FROM ZoneUser zu WHERE LOWER(zu.zoneCode)=?1 and (zu.isDeleted IS NULL OR zu.isDeleted = false) ")
public List<ZoneUser> findZoneByZoneCodeActiveAndNonDeleted(String zoneCode);

@Modifying
Expand Down

0 comments on commit 5e76bf9

Please sign in to comment.