feat(calendar): add show-unmonitored option (#2547)
* feat(calendar): add show-unmonitored option * fix: typecheck issue
This commit is contained in:
@@ -9,13 +9,17 @@ import { createCachedIntegrationRequestHandler } from "./lib/cached-integration-
|
||||
export const calendarMonthRequestHandler = createCachedIntegrationRequestHandler<
|
||||
CalendarEvent[],
|
||||
IntegrationKindByCategory<"calendar">,
|
||||
{ year: number; month: number; releaseType: RadarrReleaseType[] }
|
||||
{ year: number; month: number; releaseType: RadarrReleaseType[]; showUnmonitored: boolean }
|
||||
>({
|
||||
async requestAsync(integration, input) {
|
||||
const integrationInstance = await createIntegrationAsync(integration);
|
||||
const startDate = dayjs().year(input.year).month(input.month).startOf("month");
|
||||
const endDate = startDate.clone().endOf("month");
|
||||
return await integrationInstance.getCalendarEventsAsync(startDate.toDate(), endDate.toDate());
|
||||
return await integrationInstance.getCalendarEventsAsync(
|
||||
startDate.toDate(),
|
||||
endDate.toDate(),
|
||||
input.showUnmonitored,
|
||||
);
|
||||
},
|
||||
cacheDuration: dayjs.duration(1, "minute"),
|
||||
queryKey: "calendarMonth",
|
||||
|
||||
Reference in New Issue
Block a user