New route and button to anonymize old users
This commit is contained in:
parent
a9bb758e99
commit
0965698c90
3 changed files with 73 additions and 5 deletions
|
|
@ -19,6 +19,18 @@ export async function getUsers(promo, group) {
|
|||
}
|
||||
}
|
||||
|
||||
export async function anonOldAccounts() {
|
||||
const res = await fetch('api/users', {
|
||||
method: 'PATCH',
|
||||
headers: {'Accept': 'application/json'},
|
||||
});
|
||||
if (res.status == 200) {
|
||||
return await res.json()
|
||||
} else {
|
||||
throw new Error((await res.json()).errmsg);
|
||||
}
|
||||
}
|
||||
|
||||
export class User {
|
||||
constructor(res) {
|
||||
if (res) {
|
||||
|
|
|
|||
Reference in a new issue