separated parsing from api.getUser(), logging folreqs

This commit is contained in:
ari melody 2024-07-01 07:39:57 +01:00
parent 891aa09467
commit 6c11c67eb4
Signed by: ari
GPG key ID: CF99829C92678188
4 changed files with 10 additions and 14 deletions

View file

@ -313,15 +313,5 @@ export async function getUser(user_id) {
headers: { "Authorization": "Bearer " + get(client).app.token }
}).then(res => res.json());
const user = await parseUser(data);
if (user === null || user === undefined) {
if (data.id) {
console.warn("Failed to parse user data #" + data.id);
} else {
console.warn("Failed to parse user data:");
console.warn(data);
}
return false;
}
return user;
return data;
}