Skip to content

Commit c084a65

Browse files
committed
ap-6003 # Adjusted allowPdfDownload validation
1 parent 8e855ed commit c084a65

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@aws-sdk/client-s3": "^3.637.0",
2222
"@microsoft/eslint-plugin-sdl": "^0.2.2",
2323
"@oneblink/release-cli": "^3.4.0",
24-
"@oneblink/types": "github:oneblink/types#ap-6001",
24+
"@oneblink/types": "github:oneblink/types",
2525
"@types/content-disposition": "^0.5.8",
2626
"@types/jest": "^29.5.12",
2727
"@types/joi": "^17.2.3",

src/lib/forms-schema/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,16 @@ const formSchema = Joi.object().keys({
762762
html: htmlString,
763763
allowPDFDownload: Joi.alternatives(
764764
Joi.object(pdfSubmissionEventConfiguration),
765-
Joi.array().items(Joi.object(pdfSubmissionEventConfiguration)),
765+
Joi.array()
766+
.items(
767+
Joi.object({
768+
configuration: Joi.object(
769+
pdfSubmissionEventConfiguration,
770+
).required(),
771+
id: Joi.string().uuid().required(),
772+
}).required(),
773+
)
774+
.unique('id'),
766775
),
767776
allowAttachmentsDownload: endpointConfigurationSchema,
768777
}),

0 commit comments

Comments
 (0)