Merge pull request #277 from Hexastack/276-bug-unable-to-submit-attachment-block-edit-form

fix(api): schema support attachment_id nullable value
This commit is contained in:
Med Marrouchi
2024-10-30 08:55:53 +01:00
committed by GitHub
3 changed files with 3 additions and 1 deletions

View File

@@ -53,6 +53,7 @@ export class BlockRepository extends BaseRepository<
if (
block.message &&
'attachment' in block.message &&
block.message.attachment.payload &&
'url' in block.message.attachment.payload
) {
this.logger.error(

View File

@@ -409,6 +409,7 @@ export class BlockService extends BaseService<Block, BlockPopulate, BlockFull> {
if (
block.message &&
'attachment' in block.message &&
block.message.attachment.payload &&
'url' in block.message.attachment.payload
) {
this.logger.error(

View File

@@ -71,7 +71,7 @@ export function isValidMessage(msg: any) {
.required(),
payload: Joi.object().keys({
url: Joi.string().uri(),
attachment_id: Joi.string(),
attachment_id: Joi.string().allow(null),
}),
}),
elements: Joi.boolean(),