MomentMeal is a marketplace for food and recipes. We help you find and create the best recipes and meal plans for you.
GNU Affero General Public License v3.0
13
stars
5
forks
source link
Why is select needed on ingredient parts for getting recipe #571
Open
Andreasgdp opened 8 months ago
Figure out why it is nessesary to use select avoiding getting the assignedAt field Types of property assignedAt are incompatible. Type is Date not assignable to type string https://github.com/BHelpful/MomentMeal/blob/f59feaf2f5e075768735064bfa43c4cd8c48e92f/src/trpc/recipe/recipeRouter.ts#L163-L167
Might be to a trpc bug with inconsistent types between
Awaited< ReturnType<(typeof serverClient)['recipe']['getPublicRecipe']>
and const recipe = trpc.recipe.getPublicRecipe.useQuery( { id }, { initialData: initialRecipe, refetchOnMount: false, refetchOnReconnect: false, } ); In recipeView.tsx: https://github.com/BHelpful/MomentMeal/blob/f59feaf2f5e075768735064bfa43c4cd8c48e92f/src/components/recipeView.tsx#L36-L43