Added Update Article.
This commit is contained in:
@ -65,6 +65,7 @@ module.exports = class Articles extends DatabaseInterface {
|
||||
}
|
||||
|
||||
|
||||
|
||||
async addArticle(handle, title, image, shortDescription, description, date) {
|
||||
if(!date) date = new Date();
|
||||
let article = await this.getDatabase().one('addArticle', {
|
||||
@ -73,4 +74,12 @@ module.exports = class Articles extends DatabaseInterface {
|
||||
this.store.flush();//In future support my wildcard syntax to make this no longer necessary.
|
||||
return article;
|
||||
}
|
||||
|
||||
|
||||
|
||||
async updateArticle(article) {
|
||||
let newArticle = await this.getDatabase().one('updateArticle', article);
|
||||
this.store.flush();
|
||||
return newArticle;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user