You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
sharmag44
changed the title
Too much repeated code Using a validation library like Joi or Zod can indeed help improve code readability and provide a DRY code structure
Too much repeated code : Using a validation library like Joi or Zod can indeed help improve code readability and provide a DRY code structure
Mar 7, 2024
const email = input.email?.trim();
const username = input.username?.trim();
const password = input.password?.trim();
const { image, bio, demo } = input;
if (!email) {
throw new HttpException(422, { errors: { email: ["can't be blank"] } });
}
if (!username) {
throw new HttpException(422, { errors: { username: ["can't be blank"] } });
}
if (!password) {
throw new HttpException(422, { errors: { password: ["can't be blank"] } });
}
The text was updated successfully, but these errors were encountered: