Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ValidationError in ChannelInstance Constructor #1

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

thenasty1337
Copy link
Contributor

Fix Applied to ChannelInstance Constructor:

Added a check to ensure livestream.categories[0].description is a string. If not, it defaults to 'Default category description'.
Prevents ValidationError caused by type mismatch in channel data.

Testing:

Conducted tests to confirm the fix resolves the issue.
No additional side effects observed in related functionality.

@zSoulweaver
Copy link
Owner

Thanks for taking the time to contribute 🤘

Cheers for this, however I would prefer to implement this directly in the DTO interface, if possible, to keep everything contained by using @deepkit/type.

Either we can mark the field as an optional which will have the string | undefined type and we leave it up to the end use to their own undefined check. Alternatively, if we want to set a default value instead of exporting an interface we can export a class where we can define default values, it works much the same with @deepkit/type.

I'll have a look later after work today and get back to you.

@zSoulweaver zSoulweaver changed the title Fix ValidationError in ChannelInstance Constructor fix: ValidationError in ChannelInstance Constructor Nov 24, 2023
@zSoulweaver zSoulweaver merged commit a9957e0 into zSoulweaver:master Nov 24, 2023
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