Update api.js
This commit is contained in:
1 parent
4ac816df19
commit
daba717571
1 file changed
+12
-1
@@ -268,7 +268,6 @@ const API = {
|
||||
// ============================================================
|
||||
// 自定义页面
|
||||
// ============================================================
|
||||
|
||||
async getCustomPages() {
|
||||
const data = await apiFetch('/custom-pages');
|
||||
if (data.error) throw new Error(data.error);
|
||||
@@ -309,5 +308,17 @@ const API = {
|
||||
const data = await apiFetch('/admin/custom-pages/' + id, { method: 'DELETE' });
|
||||
if (data.error) throw new Error(data.error);
|
||||
return data;
|
||||
},
|
||||
|
||||
// ============================================================
|
||||
// 头像
|
||||
// ============================================================
|
||||
async updateAvatar(userId, avatar_url) {
|
||||
const data = await apiFetch('/users/' + userId + '/avatar', {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ avatar_url })
|
||||
});
|
||||
if (data.error) throw new Error(data.error);
|
||||
return data;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user