feat: add city/state/country to complex, new settings page with sidebar, and Biome linting
- Added city, state, and country optional fields to Complex model - Updated onboarding to include optional location fields - Created new settings page with sidebar navigation (Datos del Complejo, Canchas) - Replaced ESLint with Biome for frontend and backend linting - Added parallel dev script with concurrently - Migrated register-routes to use direct app.route() pattern
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
import nodemailer from 'nodemailer'
|
||||
import nodemailer from 'nodemailer';
|
||||
|
||||
let cachedTransporter: ReturnType<typeof nodemailer.createTransport> | null = null
|
||||
let cachedTransporter: ReturnType<typeof nodemailer.createTransport> | null = null;
|
||||
|
||||
function getTransporter() {
|
||||
if (cachedTransporter) return cachedTransporter
|
||||
if (cachedTransporter) return cachedTransporter;
|
||||
|
||||
const smtpHost = Bun.env.SMTP_HOST
|
||||
const smtpPort = Number(Bun.env.SMTP_PORT ?? 587)
|
||||
const smtpUser = Bun.env.SMTP_USER
|
||||
const smtpPass = Bun.env.SMTP_PASS
|
||||
const smtpHost = Bun.env.SMTP_HOST;
|
||||
const smtpPort = Number(Bun.env.SMTP_PORT ?? 587);
|
||||
const smtpUser = Bun.env.SMTP_USER;
|
||||
const smtpPass = Bun.env.SMTP_PASS;
|
||||
|
||||
if (!smtpHost || !smtpUser || !smtpPass) {
|
||||
throw new Error(
|
||||
'Missing SMTP env vars. Set SMTP_HOST, SMTP_PORT, SMTP_USER and SMTP_PASS.',
|
||||
)
|
||||
throw new Error('Missing SMTP env vars. Set SMTP_HOST, SMTP_PORT, SMTP_USER and SMTP_PASS.');
|
||||
}
|
||||
|
||||
cachedTransporter = nodemailer.createTransport({
|
||||
@@ -24,21 +22,21 @@ function getTransporter() {
|
||||
user: smtpUser,
|
||||
pass: smtpPass,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
return cachedTransporter
|
||||
return cachedTransporter;
|
||||
}
|
||||
|
||||
export async function sendMail(input: {
|
||||
to: string
|
||||
subject: string
|
||||
html: string
|
||||
text: string
|
||||
to: string;
|
||||
subject: string;
|
||||
html: string;
|
||||
text: string;
|
||||
}) {
|
||||
const smtpFrom = Bun.env.SMTP_FROM
|
||||
const smtpFrom = Bun.env.SMTP_FROM;
|
||||
|
||||
if (!smtpFrom) {
|
||||
throw new Error('Missing SMTP_FROM env var.')
|
||||
throw new Error('Missing SMTP_FROM env var.');
|
||||
}
|
||||
|
||||
await getTransporter().sendMail({
|
||||
@@ -47,5 +45,5 @@ export async function sendMail(input: {
|
||||
subject: input.subject,
|
||||
html: input.html,
|
||||
text: input.text,
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user