export const getGeneratedStories: GetGeneratedStories<void, Story[]> = async ( _args, context, ) => { if (!context.user) { throw new HttpError(401); } const stories = await context.entities.Story.findMany({ where: { userId: context.user.id, deletedAt: null, }, include: { pages: true, }, }); return stories; };
{stories.map((story) => { const isDisabled = story.status === "pending" || story.status === "generating"; // TypeScript error here const pageCount = story?.pages?.length || 0; return ( <></> ); })}
Join the Discord to ask follow-up questions and connect with the community
Rails-like framework for React, Node.js and Prisma. Build your app in a day and deploy it with a single CLI command.
4,603 Members
Join