Update api.js

This commit is contained in:
Furrium Network authored and GitHub committed 2026-08-10 10:34:39 +08:00
1 parent 283724fc14
commit bdfbdb7375
1 file changed
+20
+20
View File
@@ -95,6 +95,14 @@ const API = {
return data; 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); if (data.error) throw new Error(data.error);
return data; return data;
},
// ============================================================
// 置顶
// ============================================================
async togglePinPost(postId) {
const data = await apiFetch('/posts/' + postId + '/pin', {
method: 'PUT'
});
if (data.error) throw new Error(data.error);
return data;
} }
}; };