New route and button to anonymize old users

This commit is contained in:
nemunaire 2023-03-08 05:04:59 +01:00
commit 0965698c90
3 changed files with 73 additions and 5 deletions

View file

@ -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) {