fix: react-doctor errors → 0 errors, 1649 warnings (46/100)

- 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)
This commit is contained in:
Nora
2026-06-25 23:49:37 -06:00
parent 4d295ef062
commit 0ac4beaaa8
580 changed files with 52565 additions and 4953 deletions
@@ -37,7 +37,7 @@ export default function OrderDetailsModal({ order, onClose, onFulfill, onRecordD
<h2 className="text-lg font-bold text-slate-900">Order Details</h2>
<p className="text-sm text-slate-500 font-mono">{order.invoice_number ?? order.id.slice(0, 8)}</p>
</div>
<button onClick={onClose} className="text-slate-400 hover:text-slate-600">
<button type="button" onClick={onClose} className="text-slate-400 hover:text-slate-600">
<svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12"/>
</svg>
@@ -87,7 +87,7 @@ export default function OrderDetailsModal({ order, onClose, onFulfill, onRecordD
</thead>
<tbody className="divide-y divide-slate-100">
{order.items && order.items.length > 0 ? order.items.map((item, i) => (
<tr key={i}>
<tr key={item.id ?? `${item.product_name}-${i}`}>
<td className="px-4 py-2.5 font-medium text-slate-700">{item.product_name}</td>
<td className="px-4 py-2.5 text-right text-slate-600">{item.quantity}</td>
<td className="px-4 py-2.5 text-right text-slate-600">${Number(item.unit_price).toFixed(2)}</td>
@@ -132,7 +132,7 @@ export default function OrderDetailsModal({ order, onClose, onFulfill, onRecordD
{/* Actions */}
<div className="flex gap-3 pt-2">
{order.fulfillment_status !== "fulfilled" && (
<button
<button type="button"
onClick={() => onFulfill(order.id)}
disabled={fulfilling === order.id}
className="rounded-xl bg-green-600 px-4 py-2 text-sm font-semibold text-white hover:bg-green-700 disabled:opacity-50"
@@ -141,7 +141,7 @@ export default function OrderDetailsModal({ order, onClose, onFulfill, onRecordD
</button>
)}
{Number(order.balance_due) > 0 && order.fulfillment_status !== "fulfilled" && (
<button
<button type="button"
onClick={() => onRecordDeposit(order.id)}
className="rounded-xl bg-purple-600 px-4 py-2 text-sm font-semibold text-white hover:bg-purple-700"
>
@@ -156,7 +156,7 @@ export default function OrderDetailsModal({ order, onClose, onFulfill, onRecordD
>
Download Invoice
</a>
<button
<button type="button"
onClick={onClose}
className="ml-auto rounded-xl border border-slate-300 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50"
>