import prisma from "../db.server";
import { json } from "@remix-run/node";
export const loader = async ({request}) => {
  console.log(request);
  const url = new URL(request.url);
  const userId = parseInt(url.searchParams.get("userId"), 10);

    if (isNaN(userId)) {
        return json({ error: "Invalid product ID" }, { status: 400 });
    }
    const user = await prisma.users.update({
        where: {
            id:userId,
        },
        data:{
            welcome_tour:true
        }
    });
    return json({ user }, { status: 202 });
};
