Skip to content

Commit

Permalink
feat(information_management): Ability to link Knowledge Base article …
Browse files Browse the repository at this point in the history
…to a Ticket Category

ref: #426 #427
  • Loading branch information
jon-nfc committed Dec 21, 2024
1 parent 803491f commit bdda61f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/core/serializers/ticket_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ def get_url(self, item) -> dict:

return {
'_self': item.get_url( request = self._context['view'].request ),
'knowledge_base': reverse(
"v2:_api_v2_model_kb-list",
request=self._context['view'].request,
kwargs={
'model': self.Meta.model._meta.model_name,
'model_pk': item.pk
}
),
}


Expand Down
10 changes: 9 additions & 1 deletion app/core/serializers/ticket_comment_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ class TicketCommentCategoryModelSerializer(
def get_url(self, item) -> dict:

return {
'_self': item.get_url( request = self._context['view'].request )
'_self': item.get_url( request = self._context['view'].request ),
'knowledge_base': reverse(
"v2:_api_v2_model_kb-list",
request=self._context['view'].request,
kwargs={
'model': self.Meta.model._meta.model_name,
'model_pk': item.pk
}
),
}


Expand Down

0 comments on commit bdda61f

Please sign in to comment.