feat(api) Added function to get the URL of an user avatar
This commit is contained in:
parent
cb43b8a39b
commit
6c219c5226
|
@ -5,5 +5,6 @@ export * from './src/stores/';
|
||||||
export * from './src/utils/datetime';
|
export * from './src/utils/datetime';
|
||||||
export * from './src/utils/permission';
|
export * from './src/utils/permission';
|
||||||
export * from './src/utils/persistent';
|
export * from './src/utils/persistent';
|
||||||
|
export * from './src/utils/user';
|
||||||
export * from './src/utils/validators';
|
export * from './src/utils/validators';
|
||||||
export * from './src/utils/misc';
|
export * from './src/utils/misc';
|
||||||
|
|
|
@ -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' : ''
|
||||||
|
}`;
|
||||||
|
}
|
Loading…
Reference in New Issue