diff --git a/resources/js/Pages/Character/ItemDetails.vue b/resources/js/Pages/Character/ItemDetails.vue index 2c7ada61..de5783f9 100644 --- a/resources/js/Pages/Character/ItemDetails.vue +++ b/resources/js/Pages/Character/ItemDetails.vue @@ -28,6 +28,7 @@ import EveImage from "@/Shared/EveImage.vue" import PageHeader from "@/Shared/Layout/PageHeader.vue"; import ItemLayout from "@/Shared/Components/ItemLayout.vue"; +import { prefix } from "metric-prefix"; export default { name: "ItemDetails", @@ -59,13 +60,11 @@ export default { methods: { getMetricPrefix(numeric_value) { - const {prefix} = require('metric-prefix') - return prefix(numeric_value, {precision: 3, unit: 'm³'}) }, url(asset) { - return _.isEmpty(asset.content) ? '#' : route('character.item', asset.item_id) + return _.isEmpty(asset.content) ? '' : route('character.item', {'item_id': asset.item_id, 'character_id': asset.owner.character_id}) }, hasContent(content) { return !_.isEmpty(content) diff --git a/resources/js/Shared/Components/LocationSlot.vue b/resources/js/Shared/Components/LocationSlot.vue index 83b2ad89..32ab480d 100644 --- a/resources/js/Shared/Components/LocationSlot.vue +++ b/resources/js/Shared/Components/LocationSlot.vue @@ -95,6 +95,7 @@ import WideLists from "../WideLists.vue"; import WideListElement from "../WideListElement.vue"; import EveImage from "../EveImage.vue" import CardWithHeader from "@/Shared/Layout/Cards/CardWithHeader.vue"; +import { prefix } from "metric-prefix"; export default { name: "LocationSlot", @@ -124,13 +125,11 @@ export default { methods: { getMetricPrefix(numeric_value) { - const {prefix} = require('metric-prefix') - return prefix(numeric_value, {precision: 3, unit: 'm³'}) }, url(asset) { - return _.isEmpty(asset.content) ? '' : route('character.item', asset.item_id) + return _.isEmpty(asset.content) ? '' : route('character.item', {'item_id': asset.item_id, 'character_id': asset.owner.character_id}) }, hasContent(content) { return !_.isEmpty(content) diff --git a/src/Http/Controllers/Character/AssetsController.php b/src/Http/Controllers/Character/AssetsController.php index 6e506953..f75125f1 100644 --- a/src/Http/Controllers/Character/AssetsController.php +++ b/src/Http/Controllers/Character/AssetsController.php @@ -100,7 +100,10 @@ public function loadLocation(int $location_id, Request $request) public function item(int $character_id, int $item_id) { - $query = EveApiAsset::with(['location', 'type', 'type.group', 'container', 'content', 'content.content', 'content.type', 'content.type.group']) + $query = EveApiAsset::with([ + 'location', 'type', 'type.group', 'container', + 'content' => ['content', 'type', 'type.group', 'assetable'], + ]) ->where('assetable_id', $character_id) ->where('assetable_type', CharacterInfo::class) ->where('item_id', $item_id);