Fix types and condition
This commit is contained in:
@@ -14,9 +14,9 @@ export default async function sendOpenJobsEmails() {
|
|||||||
const doctorAccounts = await getDoctorAccounts();
|
const doctorAccounts = await getDoctorAccounts();
|
||||||
const doctorEmails = doctorAccounts
|
const doctorEmails = doctorAccounts
|
||||||
.map(({ email }) => email)
|
.map(({ email }) => email)
|
||||||
.filter((email) => !!email);
|
.filter((email): email is string => !!email);
|
||||||
|
|
||||||
if (doctorEmails !== null) {
|
if (doctorEmails.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user