Created
August 19, 2020 11:43
-
-
Save y-nk/a2ba7a3ca5e98234d5651442e90b51eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
post: { | |
postId: 'postId', | |
data: { | |
images: [{ | |
postId: 'childPost', | |
fileId: 'imageId', | |
}] | |
}, | |
parentId: 'parentId', | |
}, | |
reactions: [{ | |
}], | |
users: [{ | |
}], | |
comments: [{ | |
}], | |
} | |
// ----------------------------------- | |
GET /post/postId | |
-> the post | |
-> all reactions belong to post | |
-> all users belong to post | |
-> all comments belong to post | |
-> all children of post | |
UPDATE /post/postId | |
-> the post | |
-> parent post or all children of post | |
DELETE /post/postId | |
-> all mutated posts | |
childrenPosts = parentPost.children.map(id => postRepo.findById(id)) | |
{ | |
post: [ | |
{ | |
postId: 'parentId', | |
data: { | |
text: '', | |
}, | |
children: ['child1'], | |
}, | |
{ | |
postId: 'child1', | |
data: { | |
imageFileId: 'img' | |
} | |
parentId: 'parentId', | |
}] | |
reactions: [{ | |
}], | |
users: [{ | |
}], | |
comments: [{ | |
}], | |
} | |
GET /v3/xxx-feed | |
{ | |
feedOrder: [id1, id2] | |
posts: [ | |
] | |
} | |
// ---------------------------------------------------------------------------------------- | |
{ | |
post: { | |
postId: 'parentId', | |
data: { | |
images: [{ | |
postId: 'postId', | |
fileId: 'imageId', | |
}] | |
} | |
}, | |
reactions: [{ | |
}], | |
users: [{ | |
}], | |
comments: [{ | |
}], | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment