import { auth } from "@clerk/nextjs/server";
import { redirect } from "next/navigation";
import { DATABASE_ID, COLLECTION_ID_STORES, databases } from "@/appwriteConfig";
export default async function DashboardLayout({
children,
params,
}: {
children: React.ReactNode;
params: { storeId: string };
}) {
const { userId } = auth();
if (!userId) {
redirect("/sign-in");
}
const store = await databases.listDocuments(
DATABASE_ID,
COLLECTION_ID_STORES,
userId
);
}
I am building a React App with NextJS and Typescript, with a Clerk Authentication and an Appwrite Database, and I am running into this error “Argument of type ‘string’ is not assignable to parameter of type ‘string[]” on my userId inside const store. I cannot debug it, so I would appreciate your help. Thanks in advance.