mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-24 00:43:29 +10:00
chore: remove @tanstack/zod-adapter
This commit is contained in:
@@ -53,7 +53,6 @@
|
||||
"@tanstack/react-router": "^1.169.2",
|
||||
"@tanstack/react-router-ssr-query": "^1.166.12",
|
||||
"@tanstack/react-start": "^1.167.65",
|
||||
"@tanstack/zod-adapter": "^1.166.9",
|
||||
"@tiptap/extension-color": "^3.22.5",
|
||||
"@tiptap/extension-highlight": "^3.22.5",
|
||||
"@tiptap/extension-table": "^3.22.5",
|
||||
|
||||
@@ -2,7 +2,6 @@ import { t } from "@lingui/core/macro";
|
||||
import { Trans } from "@lingui/react/macro";
|
||||
import { EyeIcon, EyeSlashIcon } from "@phosphor-icons/react";
|
||||
import { createFileRoute, redirect, SearchParamError, useNavigate } from "@tanstack/react-router";
|
||||
import { zodValidator } from "@tanstack/zod-adapter";
|
||||
import { toast } from "sonner";
|
||||
import { useToggle } from "usehooks-ts";
|
||||
import z from "zod";
|
||||
@@ -16,7 +15,7 @@ const searchSchema = z.object({ token: z.string().min(1) });
|
||||
|
||||
export const Route = createFileRoute("/auth/reset-password")({
|
||||
component: RouteComponent,
|
||||
validateSearch: zodValidator(searchSchema),
|
||||
validateSearch: searchSchema,
|
||||
beforeLoad: async ({ context }) => {
|
||||
if (context.flags.disableEmailAuth) throw redirect({ to: "/auth/login", replace: true });
|
||||
},
|
||||
|
||||
@@ -4,7 +4,6 @@ import { ORPCError } from "@orpc/client";
|
||||
import { EyeIcon, EyeSlashIcon, LockOpenIcon } from "@phosphor-icons/react";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { createFileRoute, redirect, SearchParamError, useNavigate } from "@tanstack/react-router";
|
||||
import { zodValidator } from "@tanstack/zod-adapter";
|
||||
import { useMemo } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { useToggle } from "usehooks-ts";
|
||||
@@ -25,7 +24,7 @@ const searchSchema = z.object({
|
||||
|
||||
export const Route = createFileRoute("/auth/resume-password")({
|
||||
component: RouteComponent,
|
||||
validateSearch: zodValidator(searchSchema),
|
||||
validateSearch: searchSchema,
|
||||
onError: (error) => {
|
||||
if (error instanceof SearchParamError) {
|
||||
throw redirect({ to: "/" });
|
||||
|
||||
@@ -4,7 +4,6 @@ import { Trans } from "@lingui/react/macro";
|
||||
import { GridFourIcon, ListIcon, ReadCvLogoIcon } from "@phosphor-icons/react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { createFileRoute, Link, stripSearchParams, useNavigate } from "@tanstack/react-router";
|
||||
import { zodValidator } from "@tanstack/zod-adapter";
|
||||
import { useMemo } from "react";
|
||||
import z from "zod";
|
||||
import { Label } from "@reactive-resume/ui/components/label";
|
||||
@@ -25,11 +24,15 @@ const searchSchema = z.object({
|
||||
view: z.enum(["grid", "list"]).default("grid"),
|
||||
});
|
||||
|
||||
type Search = z.output<typeof searchSchema>;
|
||||
|
||||
const defaultSearch: Search = { tags: [], sort: "lastUpdatedAt", view: "grid" };
|
||||
|
||||
export const Route = createFileRoute("/dashboard/resumes/")({
|
||||
component: RouteComponent,
|
||||
validateSearch: zodValidator(searchSchema),
|
||||
validateSearch: searchSchema,
|
||||
search: {
|
||||
middlewares: [stripSearchParams({ tags: [], sort: "lastUpdatedAt", view: "grid" })],
|
||||
middlewares: [stripSearchParams(defaultSearch)],
|
||||
},
|
||||
});
|
||||
|
||||
@@ -71,7 +74,7 @@ function RouteComponent() {
|
||||
placeholder={t`Sort by`}
|
||||
onValueChange={(value) => {
|
||||
if (!value) return;
|
||||
void navigate({ search: { tags, sort: value as SortOption } });
|
||||
void navigate({ search: (prev) => ({ ...prev, sort: value as SortOption }) });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@@ -86,7 +89,7 @@ function RouteComponent() {
|
||||
options={tagOptions}
|
||||
placeholder={t`Filter by`}
|
||||
onValueChange={(value) => {
|
||||
void navigate({ search: { tags: value ?? [], sort } });
|
||||
void navigate({ search: (prev) => ({ ...prev, tags: value ?? [] }) });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@@ -97,7 +100,7 @@ function RouteComponent() {
|
||||
value="grid"
|
||||
nativeButton={false}
|
||||
className="rounded-r-none"
|
||||
render={<Link to="." search={{ view: "grid" }} />}
|
||||
render={<Link to="." search={(prev) => ({ ...prev, view: "grid" })} />}
|
||||
>
|
||||
<GridFourIcon />
|
||||
<Trans>Grid</Trans>
|
||||
@@ -107,7 +110,7 @@ function RouteComponent() {
|
||||
value="list"
|
||||
nativeButton={false}
|
||||
className="rounded-l-none"
|
||||
render={<Link to="." search={{ view: "list" }} />}
|
||||
render={<Link to="." search={(prev) => ({ ...prev, view: "list" })} />}
|
||||
>
|
||||
<ListIcon />
|
||||
<Trans>List</Trans>
|
||||
|
||||
Reference in New Issue
Block a user