Api handles updating title aswell.

This commit is contained in:
2021-01-03 23:02:27 +01:00
parent e6b1b692d6
commit 294a25b5a6
2 changed files with 5 additions and 5 deletions

View File

@@ -24,10 +24,10 @@ class PostRepository {
return this.database.get(query, [id])
}
updatePost(id, markdown="## database testost") {
const query = `UPDATE posts SET markdown = $1 WHERE id = $2`;
updatePost(id, markdown="## database testost", title="undefined title") {
const query = `UPDATE posts SET markdown = $1, title = $2 WHERE id = $3`;
const post = this.database.update(query, [markdown, id]);
const post = this.database.update(query, [markdown, title, id]);
return post
.then(post => true)