* refactor: move lighthouse audits to dataforseo * chore: remove obsolete audit settings modal * refactor: rename psi flows to lighthouse * save * refactor: simplify audit lighthouse storage flow * fix: separate lighthouse metrics from actionable audits * refactor: remove redundant audit project inputs * feat: redesign lighthouse issues screen with score gauges and table layout Replace flat score cards with circular SVG gauges, condense metrics into a compact grid, and switch issue list from cards to an expandable table with fixed column widths. * test: harden lighthouse regression coverage * fix: restore project-scoped audit inputs * refactor: simplify lighthouse payload handling * refactor: inline lighthouse server handlers * refactor: share audit workflow types * refactor: simplify lighthouse payload flows * save * refactor: drop project pagespeed api key * fix: restore lighthouse issues loading with resilient project context * fix: restore audit issues back navigation * refactor: simplify project context and lighthouse error handling * fix: tolerate DataForSEO lighthouse payload drift * refactor: route audit lighthouse through dataforseo client
23 lines
843 B
TypeScript
23 lines
843 B
TypeScript
import { createServerFn } from "@tanstack/react-start";
|
|
import { ProjectService } from "@/server/features/projects/services/ProjectService";
|
|
import { requireAuthenticatedContext } from "@/serverFunctions/middleware";
|
|
import { z } from "zod";
|
|
|
|
export const getOrCreateDefaultProject = createServerFn({ method: "POST" })
|
|
.middleware(requireAuthenticatedContext)
|
|
.handler(async ({ context }) =>
|
|
ProjectService.getOrCreateDefaultProject(context.organizationId),
|
|
);
|
|
|
|
export const getProjectAccess = createServerFn({ method: "POST" })
|
|
.middleware(requireAuthenticatedContext)
|
|
.inputValidator((data: unknown) =>
|
|
z.object({ projectId: z.string().min(1) }).parse(data),
|
|
)
|
|
.handler(async ({ data, context }) => {
|
|
return ProjectService.getProjectForOrganization(
|
|
context.organizationId,
|
|
data.projectId,
|
|
);
|
|
});
|