in src/server/lib/superMode.ts [77:94]
export async function queryActiveArticles(
stage: string,
docClient: AWS.DynamoDB.DocumentClient,
now: Date = new Date(),
): Promise<DynamoRecord[]> {
const tomorrow = addDays(now, 1);
const todayEndDate = toDateString(now);
const tomorrowEndDate = toDateString(tomorrow);
const endTimestamp = toDateHourString(now);
const [todayResult, tomorrowResult] = await Promise.all([
queryDate(todayEndDate, endTimestamp, stage, docClient),
queryDate(tomorrowEndDate, endTimestamp, stage, docClient),
]);
return [...(todayResult.Items ?? []), ...(tomorrowResult.Items ?? [])] as DynamoRecord[];
}