diff options
author | Santo Cariotti <santo@dcariotti.me> | 2022-10-17 08:25:33 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2022-10-17 08:25:33 +0200 |
commit | 16357c0e48bf1006d1fd81f944aa0ac5ddd1e70d (patch) | |
tree | 7a978c0f58153646c86b455d4773ca640f16ef51 /store/users.js | |
parent | a1b648b2bb9960d5697f8fee8a6ce7f42f896744 (diff) |
admin: Delete an user avatar
Diffstat (limited to 'store/users.js')
-rw-r--r-- | store/users.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/store/users.js b/store/users.js index 44f041c..5df1726 100644 --- a/store/users.js +++ b/store/users.js @@ -124,13 +124,12 @@ export const actions = { return res; }, // Delete the avatar - // FIX: use the right endpoint with `id`, not `me` async deleteAvatar({ commit, rootGetters }, id) { commit("loadingStatus", true, { root: true }); let res = { status: 0, data: null }; let api = this.$config.api; - await fetch(`${api}/v1/users/me/avatar`, { + await fetch(`${api}/v1/users/${id ?? "me"}/avatar`, { method: "DELETE", headers: { Authorization: `Bearer ${rootGetters["auth/accessToken"]}`, |