From 16357c0e48bf1006d1fd81f944aa0ac5ddd1e70d Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 17 Oct 2022 08:25:33 +0200 Subject: admin: Delete an user avatar --- store/users.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'store') 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"]}`, -- cgit v1.2.3-18-g5258