fix(api): Allow userid as parameter for avatarURL
This commit is contained in:
parent
1525de1469
commit
a9edc12494
|
@ -1,7 +1,6 @@
|
|||
import { api } from '../internal';
|
||||
|
||||
export function avatarURL(user: FG.User, thumbnail = true) {
|
||||
return `${api.defaults?.baseURL || ''}/users/${user.userid}/avatar${
|
||||
thumbnail ? '?thumbnail' : ''
|
||||
}`;
|
||||
export function avatarURL(user: FG.User | string, thumbnail = true) {
|
||||
if (typeof user === 'object') user = user.userid;
|
||||
return `${api.defaults?.baseURL || ''}/users/${user}/avatar${thumbnail ? '?thumbnail' : ''}`;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@flaschengeist/api": "file:./api",
|
||||
"@flaschengeist/users": "^1.0.0-alpha.2",
|
||||
"@flaschengeist/users": "^1.0.0-alpha.3",
|
||||
"axios": "^0.24.0",
|
||||
"pinia": "^2.0.6",
|
||||
"quasar": "^2.3.3"
|
||||
|
|
Loading…
Reference in New Issue