0ac4beaaa8
- Add requireAuth() to admin-permissions.ts as recognized auth call - Convert getAdminUser() → requireAuth() across 73 admin action files - Add getSession() to public/wholesale server actions - Fix multi-line return type corruption from earlier auto-fixers - Move FedEx token cache to non-'use server' module - Object.freeze module-level constants: PRICE_KEYS, EMPTY_MOBILE_DASHBOARD, EMPTY_PAY_PERIOD, LOCALE_CART_SUBJECT, WELCOME_EMAILS - Update Stripe API version 2026-05-27 → 2026-06-24 - Fix wholesale employee portal: getEmployeeSessionAction + EmployeePortalClient - Fix 51 TypeScript errors (return type corruption, missing imports)
42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
import { config } from "dotenv";
|
|
config({ path: ".env.local" });
|
|
import pg from "pg";
|
|
|
|
const { Pool } = pg;
|
|
|
|
const TUXEDO = "64294306-5f42-463d-a5e8-2ad6c81a96de";
|
|
|
|
async function main() {
|
|
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
|
|
|
try {
|
|
// brand_settings
|
|
const bs = await pool.query(
|
|
`INSERT INTO brand_settings (brand_id, legal_business_name, phone, email, logo_url, tagline, from_email)
|
|
VALUES ($1, $2, $3, $4, $5, $6, $7)
|
|
ON CONFLICT (brand_id) DO UPDATE SET legal_business_name = EXCLUDED.legal_business_name
|
|
RETURNING brand_id, legal_business_name`,
|
|
[TUXEDO, "Tuxedo Corn LLC", "970-555-0100", "info@tuxedocorn.com",
|
|
"/brand-logos/64294306-5f42-463d-a5e8-2ad6c81a96de/logo.png",
|
|
"Farm-Fresh Sweet Corn, Delivered", "orders@tuxedocorn.com"]
|
|
);
|
|
console.log("brand_settings:", bs.rows[0]);
|
|
|
|
// wholesale_settings
|
|
const ws = await pool.query(
|
|
`INSERT INTO wholesale_settings (brand_id, require_approval, pickup_location, fob_location, from_email)
|
|
VALUES ($1, true, $2, $3, $4)
|
|
ON CONFLICT (brand_id) DO UPDATE SET pickup_location = EXCLUDED.pickup_location
|
|
RETURNING brand_id, pickup_location`,
|
|
[TUXEDO, "59751 David Road, Olathe, CO 81425", "FOB Olathe, CO", "orders@tuxedocorn.com"]
|
|
);
|
|
console.log("wholesale_settings:", ws.rows[0]);
|
|
|
|
console.log("\nDone!");
|
|
} finally {
|
|
await pool.end();
|
|
}
|
|
}
|
|
|
|
main().catch((e) => { console.error(e.message); process.exit(1); });
|