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

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