DevClad-Inc / devclad

Avoid using promises in places not designed to handle them JS-0336
Anti-pattern
Major
a year agoa year old
Expected non-Promise value in a boolean conditional
 79
 80	const devMode = process.env.NODE_ENV === 'development';
 81
 82	if (!devMode && (!tokenValue || !verifyToken(tokenValue))) { 83		res.status(401).json({ error: 'Unauthorized' }).end();
 84	}
 85
Promise returned in function argument where a void return was expected
 43
 44const sendMail = async (mails: MeetingEmail[]) => {
 45	try {
 46		mails.forEach(async (email) => { 47			await axios.post('/api/email/schedule/', { 48				email, 49			}); 50		}); 51	} catch (err) {
 52		toast.custom(<Error error="Error sending emails" />);
 53	}