Added Update Article.

This commit is contained in:
2018-11-27 19:57:21 +11:00
parent 0bf91d2bed
commit b629d8c245
5 changed files with 100 additions and 4 deletions

View File

@ -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;
}
}