mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-26 09:54:43 +10:00
50ba37a27f
* chore(release): v5.1.0 * feat: implement resume thumbnails * fix: remove unused mcp tools * docs: fix formatting of docs
17 lines
581 B
TypeScript
17 lines
581 B
TypeScript
import { createServerFn } from "@tanstack/react-start";
|
|
import { getCookie, setCookie } from "@tanstack/react-start/server";
|
|
import z from "zod";
|
|
|
|
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
|
|
export const getDashboardSidebarServerFn = createServerFn({ method: "GET" }).handler(async () => {
|
|
const sidebarState = getCookie(SIDEBAR_COOKIE_NAME) !== "false";
|
|
return sidebarState;
|
|
});
|
|
|
|
export const setDashboardSidebarServerFn = createServerFn({ method: "POST" })
|
|
.inputValidator(z.boolean())
|
|
.handler(async ({ data }) => {
|
|
setCookie(SIDEBAR_COOKIE_NAME, data.toString());
|
|
});
|