[Gekidou] operator handlers improvements (#6136)

* Allow database operator handlers to deal with empty or undefined input values

* Prevent known handler warnings

* Update app/database/operator/server_data_operator/handlers/post.ts

Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>

* feedback review

* remove unnecessary !

Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
This commit is contained in:
Elias Nahum
2022-04-07 09:17:57 -04:00
committed by GitHub
parent 3326f34933
commit 0950dbd21b
41 changed files with 334 additions and 369 deletions

View File

@@ -38,7 +38,7 @@ export const sanitizePosts = ({posts, orders}: SanitizePostsArgs) => {
* @param {string} chainPosts.previousPostId
* @returns {Post[]}
*/
export const createPostsChain = ({order, posts, previousPostId = ''}: ChainPostsArgs) => {
export const createPostsChain = ({order = [], posts, previousPostId = ''}: ChainPostsArgs) => {
const postsByIds = posts.reduce((result: Record<string, Post>, p) => {
result[p.id] = p;
return result;