Skip to content

Commit

Permalink
feat(core): Add ticket linked item field metadata to api meta
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-nfc committed Jan 8, 2025
1 parent d33dd0f commit 4faafb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/core/serializers/ticket_linked_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from assistance.serializers.request import TicketBaseSerializer

from core import fields as centurion_field
from core.fields.badge import BadgeField
from core.models.ticket.ticket import Ticket
from core.models.ticket.ticket_linked_items import TicketLinkedItem
Expand Down Expand Up @@ -54,6 +55,8 @@ class TicketLinkedItemModelSerializer(
):


display_name = centurion_field.MarkdownField(source='__str__', required = True )

_urls = serializers.SerializerMethodField('get_url')

def get_url(self, item) -> dict:
Expand Down Expand Up @@ -158,6 +161,7 @@ class TicketLinkedItemViewSerializer(TicketLinkedItemModelSerializer):

item = serializers.SerializerMethodField('get_item')


def get_item(self, item) -> dict:

base_serializer: dict = None
Expand Down
2 changes: 2 additions & 0 deletions app/core/viewsets/ticket_linked_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ class ViewSet(ModelViewSet):

search_fields = []

metadata_markdown = True

model = TicketLinkedItem


Expand Down

0 comments on commit 4faafb8

Please sign in to comment.