Skip to content

Commit

Permalink
Task/prefab accepts options template key page 4926 (#480)
Browse files Browse the repository at this point in the history
* fix: update joi schema so it accepts optionsTemplate key in the componentPrefab.

* chore: rename to optionTemplates

---------

Co-authored-by: michel <[email protected]>
  • Loading branch information
M-Ryan92 and michel authored Dec 16, 2024
1 parent b26a0a1 commit 88e6dc4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/validations/prefab/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ const componentSchema = (
overwrite: overwriteSchema,
});

const optionTemplatesSchema = Joi.object({
addChild: Joi.object({
options: Joi.array().items(optionSchema).required(),
}),
});

const deprecatedStylesFlag = Object.keys(styles).length === 0;

return Joi.object({
Expand All @@ -217,6 +223,7 @@ const componentSchema = (
}),
optionCategories: Joi.array().items(optionCategorySchema).min(1),
options: Joi.array().items(optionSchema).required(),
optionTemplates: optionTemplatesSchema,
type: Joi.string().valid('COMPONENT').default('COMPONENT'),
descendants: Joi.array()
.items(
Expand Down

0 comments on commit 88e6dc4

Please sign in to comment.