feature: essays

fix: multiple rendering of things when sending
This commit is contained in:
Andy Burke 2025-09-24 13:21:39 -07:00
parent 376b7fdc24
commit b6f661c6ec
10 changed files with 537 additions and 60 deletions

View file

@ -93,7 +93,17 @@ export function VALIDATE_EVENT(event: EVENT) {
}
break;
case 'essay':
if (event.data?.essay?.length <= 0) {
if (event.data?.title?.length <= 0) {
errors.push({
cause: 'essay_title_missing',
message: 'An essay must have a title.'
});
} else if (event.data?.title?.length > 2 ** 7) {
errors.push({
cause: 'essay_title_length_limit_exceeded',
message: 'An essay title cannot be longer than 128 characters.'
});
} else if (event.data?.essay?.length <= 0) {
errors.push({
cause: 'essay_missing',
message: 'An essay cannot be empty.'