feat(life): require at least one tag for life posts
Update design spec to mandate tag selection Add frontend and backend validation for tag requirement Add localization strings for tag required errors
This commit is contained in:
@@ -2089,10 +2089,14 @@ function cleanLifePostPayload(payload: Record<string, unknown>): LifePostPayload
|
||||
if (body.length > 2000) {
|
||||
throw validationError('Post is too long');
|
||||
}
|
||||
const tagIds = cleanIds(payload.tagIds);
|
||||
if (tagIds.length === 0) {
|
||||
throw validationError('server.validation.lifeTagRequired');
|
||||
}
|
||||
|
||||
return {
|
||||
body,
|
||||
tagIds: cleanIds(payload.tagIds)
|
||||
tagIds
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user