From 7a61761b2b7707d8ad9450fd09709d0e0ee7ebd7 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 25 Oct 2023 13:25:16 +0300 Subject: [PATCH] Add schema endpoint for app profiles --- .../Profiles/App/AppProfileController.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Prowlarr.Api.V1/Profiles/App/AppProfileController.cs b/src/Prowlarr.Api.V1/Profiles/App/AppProfileController.cs index 8b3236ec4..180bc5809 100644 --- a/src/Prowlarr.Api.V1/Profiles/App/AppProfileController.cs +++ b/src/Prowlarr.Api.V1/Profiles/App/AppProfileController.cs @@ -16,6 +16,7 @@ namespace Prowlarr.Api.V1.Profiles.App public AppProfileController(IAppProfileService appProfileService) { _appProfileService = appProfileService; + SharedValidator.RuleFor(c => c.Name).NotEmpty(); } @@ -64,5 +65,14 @@ namespace Prowlarr.Api.V1.Profiles.App { return _appProfileService.All().ToResource(); } + + [HttpGet("schema")] + [Produces("application/json")] + public AppProfileResource GetTemplates() + { + var profile = _appProfileService.GetDefaultProfile(string.Empty); + + return profile.ToResource(); + } } }