diff --git a/app/Http/Resources/CharacterTraitResource.php b/app/Http/Resources/CharacterTraitResource.php index 0af0ca6883..a7e0a29d83 100644 --- a/app/Http/Resources/CharacterTraitResource.php +++ b/app/Http/Resources/CharacterTraitResource.php @@ -4,6 +4,7 @@ use App\Models\CharacterTrait; use Illuminate\Http\Resources\Json\JsonResource; +use App\Facades\Mentions; class CharacterTraitResource extends JsonResource { @@ -21,6 +22,7 @@ public function toArray($request) 'id' => $resource->id, 'name' => $resource->name, 'entry' => $resource->entry, + 'entry_parsed' => $resource->entry ? Mentions::mapAny($resource) : null, 'section_id' => $resource->section_id, 'section' => $resource->section_id == CharacterTrait::SECTION_APPEARANCE ? 'appearance' : 'personality', //'is_private' => (bool) $this->is_private, diff --git a/resources/api-docs/1.0/characters.md b/resources/api-docs/1.0/characters.md index 38c57a4366..1410ded053 100644 --- a/resources/api-docs/1.0/characters.md +++ b/resources/api-docs/1.0/characters.md @@ -62,6 +62,8 @@ The list of returned entities can be filtered. The available filters are [availa "id": 33, "name": "Goals", "entry": "Become a Paladin.", + "entry": "Become a Paladin before [character:76]", + "entry_parsed": "Become a Paladin before Baldur Gates

", "section": "personality", "section_id": 1, "default_order": 0 @@ -116,7 +118,8 @@ To get the details of a single character, use the following endpoint. { "id": 33, "name": "Goals", - "entry": "Become a Paladin.", + "entry": "Become a Paladin before [character:76]", + "entry_parsed": "Become a Paladin before Baldur Gates

", "section": "personality", "section_id": 1, "is_private": false,