From b54d0dabb0195d47056bc66c12edc6e77ec294c1 Mon Sep 17 00:00:00 2001 From: Damien Erambert Date: Sun, 31 Jul 2022 22:44:15 +0200 Subject: [PATCH] add Post#update method --- lib.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib.js b/lib.js index 555f7c6..a61bfdc 100644 --- a/lib.js +++ b/lib.js @@ -262,7 +262,18 @@ class Post { data ); - // return await Post.getById(project, postId); + return postId; + } + + /** see {@link create} */ + static async update(project, postId, data) { + await fetch( + "PUT", + `/project/${encodeURIComponent(project.handle)}/posts/${postId}`, + project.user.sessionCookie, + data + ); + return postId; }