feat(api): Add delete user function to user store
This commit is contained in:
parent
8fca175d39
commit
656d7a9e3c
|
@ -65,6 +65,13 @@ export const useUserStore = defineStore({
|
|||
return data;
|
||||
},
|
||||
|
||||
async deleteUser(user: FG.User | string) {
|
||||
if (typeof user === 'object') user = user.userid;
|
||||
|
||||
await api.delete(`/users/${user}`);
|
||||
this.users = this.users.filter(u => u.userid != user);
|
||||
},
|
||||
|
||||
async uploadAvatar(user: FG.User, file: string | File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
|
|
Loading…
Reference in New Issue