if post feeling_id < 5, set to 0

This commit is contained in:
Jonathan Barrow
2023-10-02 23:31:40 -04:00
parent 153df65692
commit ef67cfd2b7

View File

@@ -197,6 +197,11 @@ PostSchema.method<HydratedPostDocument>('json', function json(options: PostToJSO
post.community_id = community.community_id;
}
// * Some sanity checks
if (post.feeling_id < 5) {
post.feeling_id = 0;
}
return post;
});