diff --git a/_deploy/setupAppleId.mjs b/_deploy/setupAppleId.mjs index 56ba004..e8ceacb 100644 --- a/_deploy/setupAppleId.mjs +++ b/_deploy/setupAppleId.mjs @@ -11,7 +11,10 @@ if (process.argv.includes("--help") || process.argv.includes("-h")) { Usage: node apple.mjs [--kid] [--iss] [--private_key] [--sub] [--expires_in] [--exp] - + + node setupAppleId.mjs --kid YOUR_KEY_ID --iss YOUR_TEAM_ID --private_key "$(cat key.p8)" --sub YOUR_CLIENT_ID --expires_in 15778800 + + Options: --help Print this help message --kid, --key_id The key id of the private key diff --git a/pages/api/index.ts b/pages/api/index.ts index 0117451..b6a9da3 100644 --- a/pages/api/index.ts +++ b/pages/api/index.ts @@ -593,13 +593,10 @@ export async function filterPublishers(selectFields, searchText, filterDate, fet // Check if dayOfMonth is null and match by day of week using the enum (Assigments every week) // This includes availabilities from previous assignments but not with preference { - dayOfMonth: null, + dayOfMonth: null, // includes monthly and weekly repeats dayofweek: dayOfWeekEnum, // ToDo: and weekOfMonth //startTime: { gte: currentMonthStart }, - }, - { - repeatWeekly: true, } ] } @@ -620,7 +617,6 @@ export async function filterPublishers(selectFields, searchText, filterDate, fet dayOfMonth: null, dayofweek: dayOfWeekEnum, } - ] } }; } @@ -741,6 +737,11 @@ export async function filterPublishers(selectFields, searchText, filterDate, fet return avail.dayOfMonth != null && avail.startTime >= currentMonthStart; // && avail.startTime <= currentMonthEnd; }); + //if pub has availabilities for the current day + pub.hasAvailabilityForCurrentDay = pub.availabilities?.some(avail => { + return avail.startTime >= filterDate && avail.startTime <= filterDateEnd; + }); + }); if (filterDate && useDateFilter) {