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';
|
import { api } from '../internal';
|
||||||
|
|
||||||
export function avatarURL(user: FG.User, thumbnail = true) {
|
export function avatarURL(user: FG.User | string, thumbnail = true) {
|
||||||
return `${api.defaults?.baseURL || ''}/users/${user.userid}/avatar${
|
if (typeof user === 'object') user = user.userid;
|
||||||
thumbnail ? '?thumbnail' : ''
|
return `${api.defaults?.baseURL || ''}/users/${user}/avatar${thumbnail ? '?thumbnail' : ''}`;
|
||||||
}`;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@flaschengeist/api": "file:./api",
|
"@flaschengeist/api": "file:./api",
|
||||||
"@flaschengeist/users": "^1.0.0-alpha.2",
|
"@flaschengeist/users": "^1.0.0-alpha.3",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"pinia": "^2.0.6",
|
"pinia": "^2.0.6",
|
||||||
"quasar": "^2.3.3"
|
"quasar": "^2.3.3"
|
||||||
|
|
Loading…
Reference in New Issue