core: add provider_obj field to applications API

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-11 13:31:31 +02:00
parent cb048764f4
commit 8df29235bb
2 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class ApplicationSerializer(ModelSerializer):
"""Application Serializer"""
launch_url = SerializerMethodField()
provider = ProviderSerializer(source="get_provider", required=False)
provider_obj = ProviderSerializer(source="get_provider", required=False)
def get_launch_url(self, instance: Application) -> Optional[str]:
"""Get generated launch URL"""
@ -49,6 +49,7 @@ class ApplicationSerializer(ModelSerializer):
"name",
"slug",
"provider",
"provider_obj",
"launch_url",
"meta_launch_url",
"meta_icon",

View File

@ -14456,6 +14456,10 @@ definitions:
maxLength: 50
minLength: 1
provider:
title: Provider
type: integer
x-nullable: true
provider_obj:
$ref: '#/definitions/Provider'
launch_url:
title: Launch url