forked from andyburke/autonomous.contact
feature: essays
fix: multiple rendering of things when sending
This commit is contained in:
parent
376b7fdc24
commit
b6f661c6ec
10 changed files with 537 additions and 60 deletions
|
|
@ -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.'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue