Food Recipe App using MERN Stack | #3

preview_player
Показать описание
Food Recipe App using MERN Stack | #3, In this video and the rest of the playlist, we will build a food recipe web app using NodeJs, ExpressJs, ReactJs and MongoDB.
This video covers validation of your express application using the yup library, this would save us the stress of creating controller-level validation instead having a dynamic validation using the yup package.

This entails:
1. Validation using Yup
2. Route and controller setup

In the end, you should have learnt how to validate your express application using the yup library.

The whole project itself covers a wide range of topics such as authentication, authorization, routing, protected routing, caching and advanced query in addition to fuzzy searching.

Sit back and relax as we build this awesome project that you can extend to make it yours and showcase it in your portfolio.

____ Contents of this Video____

00:00 - Intro

______DO NOT FORGET_____
Please share, like, comment and subscribe.

IMPORTANT LINK

👊 Stay connected with me

👍 Don't forget to like and subscribe

#typescript #nodejs #programming #mongodb #react #mongoose #expressjs
Рекомендации по теме
Комментарии
Автор

Please like, share, comment and subscribe 👍

ikechukwupeter
Автор

const createRecipeSchema: yup.AnyObjectSchema = yup.object({
body: yup.object({
title: yup.string().required("title is required"),
note: yup.string(),
ingredients: is required"),
description: is required"),
}),
});

ERROR:

Type 'ObjectSchema<{ body: { note?: string | undefined; description: string; title: string; ingredients: string; }; }, any, { body: { title: undefined; note: undefined; ingredients: undefined; description: undefined; }; }, "">' is not assignable to type 'AnyObjectSchema'.
The types of 'default(...).concat' are incompatible between these types.
Type '{ <IIn extends Maybe<AnyObject>, IC, ID, IF extends Flags>(schema: ObjectSchema<IIn, IC, ID, IF>): body: { note?: string | undefined; description: string; title: string; ingredients: string; }; }, IIn>, any, Extract<...> extends never ? ID | (ID extends AnyObject ? _<...> | _<...> : ...' is not assignable to type '{ <IIn extends Maybe<AnyObject>, IC, ID, IF extends Flags>(schema: ObjectSchema<IIn, IC, ID, IF>): ObjectSchema<ConcatObjectTypes<any, IIn>, any, Extract<...> extends never ? ID | (ID extends AnyObject ? _<...> | _<...> : ID) : ID, any>; (schema: ObjectSchema<...>): ObjectSchema<...>; }'.
Types of parameters 'schema' and 'schema' are incompatible.
Type 'ObjectSchema<any, any, any, any>' is not assignable to type 'ObjectSchema<{ body: { note?: string | undefined; description: string; title: string; ingredients: string; }; }, any, any, "d">'.
Types of property 'fields' are incompatible.
Property 'body' is missing in type 'Shape<any, any>' but required in type 'Shape<{ body: { note?: string | undefined; description: string; title: string; ingredients: string; }; }, any>'.ts(2322)
index.ts(4, 3): 'body' is declared here.

amsul