// import { yup } from 'validations';
// import { BadRequestException } from '@nestjs/common';

// export const validateSchema = <T>(schema: yup.ObjectSchema<T>, data: T) => {
//   try {
//     return schema.validate(data, {
//       abortEarly: false,
//       stripUnknown: true,
//     });
//   } catch (e) {
//     console.error(e);
//     throw new BadRequestException(e.errors);
//   }
// };
