Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.1 KB

API.md

File metadata and controls

34 lines (22 loc) · 1.1 KB

PostableModel

PostableModel is a BaseModel mixin which adds posting capabilities to models you create.

class Group extends PostableModel(BaseModel) {
    constructor(doc){
        super(doc);
    }
}

Methods

addPost(body) - Add a post connected to the model.

posts(options) - Retrieve the posts for the model. Signature of options param is the same as you would pass to Collection.find().

Post

Extends BaseModel, Implements CommentableModel and LikeableModel

Model for the record of each post on a connected Model.

Methods

poster() - The user who added the post to the feed. Poster may return the same as user if the user created the post in their own feed.

canRemove() - Check if the user is allowed to delete the post. The poster and the owner can both delete the post.

canUpdate() - Check if the user is allowed to update the post. Only poster can change a post.