Skip to content

Commit

Permalink
fix: allow string fields to also accept numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Aug 8, 2022
1 parent 9540b24 commit 743ce57
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "climate-warehouse",
"version": "1.1.1",
"version": "1.1.2",
"private": true,
"bin": "build/server.js",
"type": "module",
Expand Down
16 changes: 10 additions & 6 deletions src/validations/projects.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ export const baseSchema = {
originProjectId: Joi.alternatives()
.try(Joi.string(), Joi.number())
.required(),
registryOfOrigin: Joi.string().required(),
registryOfOrigin: Joi.alternatives()
.try(Joi.string(), Joi.number())
.required(),
program: Joi.string().optional(),
projectName: Joi.string().required(),
projectLink: Joi.string().required(),
projectDeveloper: Joi.string().required(),
sector: Joi.string().required(),
projectName: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
projectLink: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
projectDeveloper: Joi.alternatives()
.try(Joi.string(), Joi.number())
.required(),
sector: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
projectType: Joi.string()
.custom(pickListValidation('projectType'))
.required(),
Expand All @@ -38,7 +42,7 @@ export const baseSchema = {
.required(),
projectStatusDate: Joi.date().required(),
unitMetric: Joi.string().custom(pickListValidation('unitMetric')).required(),
methodology: Joi.string().required(),
methodology: Joi.alternatives().try(Joi.string(), Joi.number()).required(),
methodology2: Joi.string().optional(),
validationBody: Joi.string()
.custom(pickListValidation('validationBody'))
Expand Down

0 comments on commit 743ce57

Please sign in to comment.