fix(api): Allow userid as parameter for avatarURL

This commit is contained in:
Ferdinand Thiessen 2021-12-06 12:51:47 +01:00
parent 1525de1469
commit a9edc12494
2 changed files with 4 additions and 5 deletions

View File

@ -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' : ''}`;
}`;
} }

View File

@ -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"