update query for communities, fix hardcoded mail

This commit is contained in:
argirok 2025-02-21 14:55:38 +02:00
parent 29b48bc8b2
commit c69a1ba450
2 changed files with 7 additions and 1 deletions

View File

@ -320,7 +320,7 @@ public class ClaimController {
@RequestParam(name = "types", defaultValue = "") ArrayList<String> types,
@RequestParam(name = "mine", defaultValue = "false") Boolean mine) {
Pageable pageable = PageRequest.of(offset, limit);
return claimService.getClaimsBySource(pageable, mine, "alexandros.martzios@gmail.com", types, orderby, descending, keyword, "context", contextId);
return claimService.getClaimsBySource(pageable, mine, authorizationService.getEmail(), types, orderby, descending, keyword, "context", contextId);
}
@PreAuthorize("isAuthenticated()")

View File

@ -58,6 +58,12 @@ public class QueryGenerator {
"c.sourceType = :sourceType " +
" AND c.sourceId = :sourceId" +
")";
if(type == "context"){
q = "AND (" +
"c.sourceType = :sourceType " +
" AND c.sourceId LIKE CONCAT(:sourceId, '%') " +
")";
}
return q;
}
public static String getDateClause(Date from, Date to) {