new Post(title, content, author)
Parameters:
| Name | Type | Description |
|---|---|---|
title |
string | |
content |
string | |
author |
string |
- Source:
Members
author :string
Type:
- string
- Source:
content :string
Type:
- string
- Source:
createdAt :Date
Type:
- Date
- Source:
id :string
Type:
- string
- Source:
status :Status
Type:
- Source:
title :string
Type:
- string
- Source:
Methods
(static) fromObject(obj) → {Post}
Creates a Post instance from a plain object.
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
Object |
- Source:
Returns:
- Type
- Post
(async, static) getAll() → {Promise.<Array.<Post>>}
Retrieves all posts from the database.
- Source:
Returns:
- Type
- Promise.<Array.<Post>>
(async) save() → {Promise.<void>}
Saves a post to the database.
- Source:
Returns:
- Type
- Promise.<void>