Skip to content

Commit

Permalink
feat: Disable realization status update from stream once reward sent -
Browse files Browse the repository at this point in the history
…MEED-3437 - Meeds-io/MIPs#122 (#514)

This PR will ensure disabling the update achievement status from the
stream once the reward is sent.
  • Loading branch information
AzmiTouil committed May 7, 2024
1 parent 0c43f41 commit d7ecfd5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ public Response getRewardReportPeriods(@Parameter(description = "Offset of resul
if (offset < 0) {
return Response.status(Response.Status.BAD_REQUEST).entity("Offset must be 0 or positive").build();
}
List<RewardPeriod> rewardPeriods = rewardReportService.findRewardPeriodsBetween(from, to, offset, limit);
List<RewardPeriod> rewardPeriods;
if (from >= 0 && to > 0) {
rewardPeriods = rewardReportService.findRewardPeriodsBetween(from, to, offset, limit);
} else {
rewardPeriods = rewardReportService.findRewardReportPeriods(offset, limit);
}
return Response.ok(rewardPeriods).build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
*/
export function getRewardReportPeriods(from, to, offset, limit) {
return fetch(`/portal/rest/wallet/api/reward/periods?from=${from}&to=${to}&offset=${offset || 0}&limit=${limit|| 10}`, {
return fetch(`/portal/rest/wallet/api/reward/periods?from=${from || 0}&to=${to || 0}&offset=${offset || 0}&limit=${limit|| 10}`, {
method: 'GET',
credentials: 'include',
headers: {
Expand Down

0 comments on commit d7ecfd5

Please sign in to comment.