Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create/Edit post #21

Open
1 of 2 tasks
GansukhB opened this issue Dec 20, 2021 · 0 comments
Open
1 of 2 tasks

Create/Edit post #21

GansukhB opened this issue Dec 20, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@GansukhB
Copy link
Owner

GansukhB commented Dec 20, 2021

  • Create Post model - common/models/Post.js
userId,
topicId, //optional
body, //text, maxlen: 1000, index. 
images: // string list //optional,
comments: [Comment] //comment list,
commentCount, //integer, default: 0,
likes: [userId], //user id ObjectId list
likeCount: //integer, default: 0
bookmarks: [userId], //ObjectId list of userIds, 
bookmarkCount: //integer, default: 0
timestamps: true
  • Create/Update post

URL: /createPost
Method: POST

{
  "topicId": <topic id>, //optional, if topic doesn't exist, return 404
  "body": <body text>, //required, length 1000s iluuu bol return 400
  "images": <list of strings>,  
}

//userId-г accessToken-с авна

Response:

{
  "_id": <post id>,
  "userId": <user id>,
  "topicId": <topic id>, 
  "body": <body text>,
  "images": <list of strings>,  
}
@GansukhB GansukhB added the post label Dec 20, 2021
@GansukhB GansukhB added this to the mvp milestone Dec 20, 2021
@GansukhB GansukhB mentioned this issue Dec 20, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants