From 8fa81a7134b595e3857d7719a8f45bb378d77b7e Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 9 Apr 2021 19:57:46 +0200 Subject: Added group id to dataset of wreck elements --- derelict.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/derelict.js b/derelict.js index f328db6..4e735ce 100644 --- a/derelict.js +++ b/derelict.js @@ -64,9 +64,14 @@ class Wreck { const team = killmail.team > 1 ? "teamA" : "teamB" this.domElement.classList.add('wreck', team) const shipTypeId = this.killmail.victim.ship_type_id - fetch(`${ESI}/universe/types/${shipTypeId}/?datasource=tranquility`, {cache: "force-cache"}) + fetch(`${ESI}/universe/types/${shipTypeId}/`, {cache: "force-cache"}) .then(response => response.json()) - .then(typeId => this.domElement.dataset.label = typeId.name) + .then(typeId => { + this.domElement.dataset.label = typeId.name + return fetch(`${ESI}/universe/groups/${typeId.group_id}/`, {cache: "force-cache"}) + }) + .then(response => response.json()) + .then(group => this.domElement.dataset.group = group.name) this.domElement.appendChild(iconElement) this.point.position.copy(killmail.victim.position) this.point.add(object2d) -- cgit v1.1