Skip to content

Commit

Permalink
Merge pull request #790 from Chia-Network/feature/unit-split-unitstatus
Browse files Browse the repository at this point in the history
Feature/unit split unitstatus
  • Loading branch information
MichaelTaylor3D authored Jan 10, 2023
2 parents 7be9fe1 + 75b2746 commit bf73d6b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/controllers/units.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ export const split = async (req, res) => {
newRecord.unitOwner = record.unitOwner;
}

if (record.unitStatus) {
newRecord.unitStatus = record.unitStatus;
}

if (record.countryJurisdictionOfOwner) {
newRecord.countryJurisdictionOfOwner =
record.countryJurisdictionOfOwner;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/string-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export function isPluralized(name) {
return name.endsWith('s');
}

export const genericFilterRegex = /(\w+):(.+):(in|eq|not|lt|gt|lte|gte)/;
export const genericFilterRegex = /(\w+):(.+):(in|eq|not|lt|gt|lte|gte|like)/;
export const isArrayRegex = /\[.+\]/;
export const genericSortColumnRegex = /(\w+):(ASC|DESC)/;
3 changes: 3 additions & 0 deletions src/validations/units.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export const unitsSplitSchema = Joi.object({
unitBlockStart: Joi.string().required(),
unitBlockEnd: Joi.string().required(),
unitOwner: Joi.string().optional(),
unitStatus: Joi.string()
.custom(pickListValidation('unitStatus'))
.optional(),
countryJurisdictionOfOwner: Joi.string()
.custom(pickListValidation('countries', 'countryJurisdictionOfOwner'))
.optional(),
Expand Down

0 comments on commit bf73d6b

Please sign in to comment.