comty/docs/docs/comty-js/models/post/get-post-data.md
2024-08-26 13:52:48 +00:00

749 B

sidebar_position
sidebar_position
4

Get post data

Retrieves the data of a post.


```js async function PostModel.post(payload) ```

[Object] Payload

Parameter Type Optional Default Description
post_id string false Defines the ID of the post to retrieve.

Success Response

Parameter Type Content
data object post_obj

Examples

Basic usage

const post = await PostModel.post({
    post_id: "0000",
})

console.log(post)

// result: { 
//   _id: "0000", 
//   user_id: "0000", 
//   message: "example text",
//   ...
// }