This commit is contained in:
j3d1 2023-05-11 04:09:26 +02:00
parent e89c261f56
commit a5ca19ddf8
5 changed files with 20968 additions and 13 deletions

View file

@ -115,9 +115,11 @@ export default {
async getInventoryItems() {
try {
const servers = await this.getFriends().then(friends => friends.map(friend => this.getFriendServer({username: friend})))
const urls = servers.map(server => server.then(s => `http://${s}/api/inventory_items/`))
const urls = servers.map(server => server.then(s => {
return {host: `http://${s}`, target: "/api/inventory_items/"}
}))
urls.map(url => url.then(u => this.apiFederatedGet(u).then(items => {
this.setInventoryItems({url: u, items})
this.setInventoryItems({url: u.domain, items})
}).catch(e => {
}))) // TODO: handle error
} catch (e) {