Add PocketBase login, first-sign-in password changes, account settings, and user activation, reactivation and deletion with self-removal guards. Protect application pages and APIs and keep private pages out of PWA caches. Resolve plant locations from site assignments and improve map controls, profit chart views, navigation and mobile table layouts. Validation: production build and TypeScript passed; 28 unit tests passed. Backend access integration tests and mobile verification are documented.
13 lines
563 B
TypeScript
13 lines
563 B
TypeScript
export function canReplaceRetrySource(status: number, result: { ok?: boolean; status?: string; intakeId?: string }) {
|
|
return (status >= 200 && status < 300 && result.ok === true) ||
|
|
(status === 422 && result.status === "failed" && typeof result.intakeId === "string" && /^[a-z0-9]{15}$/.test(result.intakeId));
|
|
}
|
|
|
|
export function intakeRetryHeaders(request: Request) {
|
|
const headers = new Headers();
|
|
for (const name of ["cookie", "origin"]) {
|
|
const value = request.headers.get(name);
|
|
if (value) headers.set(name, value);
|
|
}
|
|
return headers;
|
|
}
|