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
+16 -14
View File
@@ -162,8 +162,10 @@ function WaterFieldInner() {
if (step === "form" && headgates.length === 0) {
loadHeadgates();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
// loadHeadgates depends on TUXEDO_BRAND_ID + setters which never change
// across the component's lifetime, so we keep the dep list focused on
// the state we actually gate the load on.
}, [step, headgates.length]);
// QR-locked headgate: derive during render instead of syncing in an effect.
// When qrHeadgateToken matches a loaded headgate, override the user's
@@ -377,13 +379,13 @@ function WaterFieldInner() {
</p>
<p className="text-[#57694e] text-center mb-8 text-sm">{t.selectLang}</p>
<div className="flex flex-col gap-3">
<button
<button type="button"
onClick={() => handleLangSelect("en")}
className="w-full rounded-xl bg-white px-6 py-5 text-xl font-semibold text-[#1d1d1f] shadow-sm ring-1 ring-[#d4d9d3] hover:bg-[#f0fdf4] hover:ring-[#1a4d2e] transition min-h-[64px]"
>
English
</button>
<button
<button type="button"
onClick={() => handleLangSelect("es")}
className="w-full rounded-xl bg-white px-6 py-5 text-xl font-semibold text-[#1d1d1f] shadow-sm ring-1 ring-[#d4d9d3] hover:bg-[#f0fdf4] hover:ring-[#1a4d2e] transition min-h-[64px]"
>
@@ -400,7 +402,7 @@ function WaterFieldInner() {
return (
<div className="min-h-screen bg-[#fdfaf2] flex flex-col items-center justify-center p-6">
<div className="w-full max-w-xs">
<button
<button type="button"
onClick={() => setStep("lang")}
className="text-sm text-[#57694e] mb-6 hover:text-[#1a4d2e]"
>
@@ -414,13 +416,13 @@ function WaterFieldInner() {
</h1>
<p className="text-[#57694e] text-center mb-8">{t.whoAreYou}</p>
<div className="flex flex-col gap-3">
<button
<button type="button"
onClick={() => { setStep("pin"); }}
className="w-full rounded-xl bg-white px-6 py-5 text-xl font-semibold text-[#1d1d1f] shadow-sm ring-1 ring-[#d4d9d3] hover:bg-[#f0fdf4] hover:ring-[#1a4d2e] transition min-h-[64px]"
>
Irrigator
</button>
<button
<button type="button"
onClick={() => { setStep("pin"); }}
className="w-full rounded-xl bg-[#1a4d2e] px-6 py-5 text-xl font-semibold text-white shadow-sm ring-1 ring-[#1a4d2e] hover:bg-[#14532d] transition min-h-[64px]"
>
@@ -437,7 +439,7 @@ function WaterFieldInner() {
return (
<div className="min-h-screen bg-[#fdfaf2] flex flex-col items-center justify-center p-6">
<div className="w-full max-w-xs">
<button
<button type="button"
onClick={() => setStep("role")}
className="text-sm text-[#57694e] mb-6 hover:text-[#1a4d2e]"
>
@@ -452,7 +454,7 @@ function WaterFieldInner() {
<p className="text-[#57694e] text-center mb-8">{t.enterPin}</p>
<form onSubmit={handlePinSubmit}>
<input
<input aria-label="Password"
type="password"
inputMode="numeric"
pattern="[0-9]*"
@@ -502,7 +504,7 @@ function WaterFieldInner() {
</p>
</div>
</div>
<button
<button type="button"
onClick={handleLogout}
className="rounded-lg bg-[#14532d] px-4 py-2 text-sm font-semibold text-white hover:bg-[#166534] transition-colors min-h-[44px]"
>
@@ -574,7 +576,7 @@ function WaterFieldInner() {
<span className="text-stone-500 text-base font-medium">Loading headgates...</span>
</div>
) : (
<select
<select aria-label="Select"
value={effectiveSelectedHeadgate}
onChange={(e) => setSelectedHeadgate(e.target.value)}
required
@@ -603,7 +605,7 @@ function WaterFieldInner() {
<label className="block text-base font-semibold text-stone-700 mb-2">
{t.measurement}
</label>
<input
<input aria-label="0.00"
type="number"
step="any"
value={measurement}
@@ -618,7 +620,7 @@ function WaterFieldInner() {
<label className="block text-base font-semibold text-stone-700 mb-2">
{t.unit}
</label>
<select
<select aria-label="Select"
value={unit}
onChange={(e) => setUnit(e.target.value)}
className="w-full rounded-xl border-2 border-stone-300 bg-white px-4 py-4 text-lg font-semibold outline-none focus:border-stone-900 min-h-[60px]"
@@ -693,7 +695,7 @@ function WaterFieldInner() {
<label className="block text-base font-semibold text-stone-700 mb-2">
{t.notes}
</label>
<textarea
<textarea aria-label="Textarea"
value={notes}
onChange={(e) => setNotes(e.target.value)}
placeholder={t.notesPlaceholder}