feat(api) Added function to get the URL of an user avatar

This commit is contained in:
Ferdinand Thiessen 2021-11-29 17:21:49 +01:00
parent cb43b8a39b
commit 6839ae5742
1 changed files with 7 additions and 0 deletions

7
api/src/utils/user.ts Normal file
View File

@ -0,0 +1,7 @@
import { api } from '../internal';
export function avatarURL(user: FG.User, thumbnail = true) {
return `${api.defaults?.baseURL || ''}/users/${user.userid}/avatar${
thumbnail ? '?thumbnail' : ''
}`;
}