add Post#update method

pull/1/head
Damien Erambert 2022-07-31 22:44:15 +02:00
parent 54568fa886
commit b54d0dabb0
No known key found for this signature in database
GPG Key ID: 519179F777AE5A0F
1 changed files with 12 additions and 1 deletions

13
lib.js
View File

@ -262,7 +262,18 @@ class Post {
data 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; return postId;
} }