import { Router } from "express"; import { db } from "../db.ts"; import type { AuthedRequest } from "../lib/auth.ts"; import { err } from "../lib/auth.ts"; export const businessRouter = Router(); businessRouter.get("/", (req: AuthedRequest, res) => { const b = db .prepare( `SELECT id, name, industry, currency, currency_symbol, phone, address FROM businesses WHERE id = ?` ) .get(req.user!.business_id); if (!b) return err(res, 404, "Negocio no encontrado"); res.json({ business: b }); });