Update api.js
This commit is contained in:
1 parent
283724fc14
commit
bdfbdb7375
1 file changed
+20
@@ -95,6 +95,14 @@ const API = {
|
||||
return data;
|
||||
},
|
||||
|
||||
async togglePinPost(postId) {
|
||||
const data = await apiFetch('/posts/' + postId + '/pin', {
|
||||
method: 'PUT'
|
||||
});
|
||||
if (data.error) throw new Error(data.error);
|
||||
return data;
|
||||
},
|
||||
|
||||
// ============================================================
|
||||
// 回复
|
||||
// ============================================================
|
||||
@@ -376,5 +384,17 @@ const API = {
|
||||
});
|
||||
if (data.error) throw new Error(data.error);
|
||||
return data;
|
||||
},
|
||||
|
||||
// ============================================================
|
||||
// 置顶
|
||||
// ============================================================
|
||||
|
||||
async togglePinPost(postId) {
|
||||
const data = await apiFetch('/posts/' + postId + '/pin', {
|
||||
method: 'PUT'
|
||||
});
|
||||
if (data.error) throw new Error(data.error);
|
||||
return data;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user