-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add embed with required completion to didacticiel-modulix.…
…json Co-authored-by: Clément Latzarus <clement.latzarus@pix.fr>
- Loading branch information
Showing
5 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...ests/devcomp/unit/infrastructure/datasources/learning-content/validation/element/embed.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Joi from 'joi'; | ||
|
||
import { htmlNotAllowedSchema, uuidSchema } from '../utils.js'; | ||
|
||
const embedSchema = Joi.object({ | ||
id: uuidSchema, | ||
type: Joi.string().valid('embed').required(), | ||
isCompletionRequired: Joi.boolean().valid(false).required(), | ||
title: htmlNotAllowedSchema.required(), | ||
url: Joi.string().uri().required(), | ||
height: Joi.number().min(0).required(), | ||
}).required(); | ||
|
||
export { embedSchema }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters