apple ID setup cmd, backend API tweaks

This commit is contained in:
Dobromir Popov
2024-04-02 01:13:08 +03:00
parent 164c64f5df
commit 5901c11761
2 changed files with 10 additions and 6 deletions

View File

@ -11,7 +11,10 @@ if (process.argv.includes("--help") || process.argv.includes("-h")) {
Usage: Usage:
node apple.mjs [--kid] [--iss] [--private_key] [--sub] [--expires_in] [--exp] 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: Options:
--help Print this help message --help Print this help message
--kid, --key_id The key id of the private key --kid, --key_id The key id of the private key

View File

@ -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) // 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 // This includes availabilities from previous assignments but not with preference
{ {
dayOfMonth: null, dayOfMonth: null, // includes monthly and weekly repeats
dayofweek: dayOfWeekEnum, dayofweek: dayOfWeekEnum,
// ToDo: and weekOfMonth // ToDo: and weekOfMonth
//startTime: { gte: currentMonthStart }, //startTime: { gte: currentMonthStart },
},
{
repeatWeekly: true,
} }
] ]
} }
@ -620,7 +617,6 @@ export async function filterPublishers(selectFields, searchText, filterDate, fet
dayOfMonth: null, dayOfMonth: null,
dayofweek: dayOfWeekEnum, dayofweek: dayOfWeekEnum,
} }
]
} }
}; };
} }
@ -741,6 +737,11 @@ export async function filterPublishers(selectFields, searchText, filterDate, fet
return avail.dayOfMonth != null && avail.startTime >= currentMonthStart; // && avail.startTime <= currentMonthEnd; 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) { if (filterDate && useDateFilter) {