import { createServerFn } from "@tanstack/react-start";
import { superTokensFunctionMiddleware } from "./supertokens";
import { serverEvents } from "@/lib/events/emitter";

export const testEvent = createServerFn()
  .middleware([superTokensFunctionMiddleware])
  .handler(async ({ context }) => {
    serverEvents.emit("test", {
      type: "test",
      userId: context.userAuthId,
    });
  });
