Files
threadcount-community/app/app/stocktake/page.tsx
T
ThreadCount 859fb6ec78
Release / release (push) Has been skipped
ThreadCount Community edition
Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from 267c956 on 2026-09-17. Licensed under the Functional Source License (FSL-1.1-ALv2).
2026-09-17 18:06:29 +10:00

16 lines
722 B
TypeScript

import { redirect } from "next/navigation";
/* The stock take moved into Stock as its Count tab. next.config.ts redirects this path too; the
stub keeps an old bookmark working (with its query) if that redirect is ever missing. */
export default async function StocktakeRedirect({ searchParams }: { searchParams: Promise<Record<string, string | string[] | undefined>> }) {
const sp = await searchParams;
const q = new URLSearchParams();
for (const [k, v] of Object.entries(sp)) {
if (k === "tab") continue;
if (Array.isArray(v)) v.forEach((x) => q.append(k, x));
else if (v !== undefined) q.append(k, v);
}
const rest = q.toString();
redirect(`/app/stock?tab=count${rest ? "&" + rest : ""}`);
}