fix: handle null pool and adjust week calculation rules
Some checks failed
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
Some checks failed
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -113,8 +113,8 @@ public class GetAvailableWeeksQueryHandler : IRequestHandler<GetAvailableWeeksQu
|
||||
var calendar = CultureInfo.InvariantCulture.Calendar;
|
||||
var weekOfYear = calendar.GetWeekOfYear(
|
||||
date,
|
||||
CalendarWeekRule.FirstFourDayWeek,
|
||||
DayOfWeek.Monday);
|
||||
CalendarWeekRule.FirstDay,
|
||||
DayOfWeek.Saturday);
|
||||
|
||||
return $"{date.Year}-W{weekOfYear:D2}";
|
||||
}
|
||||
|
||||
@@ -27,6 +27,6 @@ public class GetWeeklyCommissionPoolQueryHandler : IRequestHandler<GetWeeklyComm
|
||||
})
|
||||
.FirstOrDefaultAsync(cancellationToken);
|
||||
|
||||
return pool;
|
||||
return pool??new WeeklyCommissionPoolDto();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user