Skip to content

[USH-1756] Post with required image field is not working as expected.#1520

Merged
MMwandigha merged 3 commits intodevelopmentfrom
USH-1756
Feb 6, 2025
Merged

[USH-1756] Post with required image field is not working as expected.#1520
MMwandigha merged 3 commits intodevelopmentfrom
USH-1756

Conversation

@MMwandigha
Copy link
Contributor

Made the validator more robust to handle various cases;

  • If the value is an array, it checks whether the array has at least one element (value.length > 0).
  • If the value is an object, it checks for the presence of at least one media type (photo, audio, or doc).

Also renamed PhotoRequired to MediaRequired to account for the multiple media types

@linear
Copy link

linear bot commented Feb 5, 2025

Copy link
Contributor

@Angamanga Angamanga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine now 🙌

@MMwandigha MMwandigha merged commit 681d2e9 into development Feb 6, 2025
6 of 8 checks passed
tuxpiper pushed a commit that referenced this pull request Feb 13, 2025
…#1520)

* media validation to check value if array/object for diff media types

* changing media validation to use 'mediaRequired' instead of 'photoRequired'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants