@ -58,9 +58,9 @@ namespace Readarr.Api.V1
}
[RestPostById]
public ActionResult < TProviderResource > CreateProvider ( TProviderResource providerResourc e)
public ActionResult < TProviderResource > CreateProvider ( [ FromBody ] TProviderResource providerResourc e, [ FromQuery ] bool forceSave = fals e)
{
var providerDefinition = GetDefinition ( providerResource , true , fals e, false ) ;
var providerDefinition = GetDefinition ( providerResource , true , ! forceSav e, false ) ;
if ( providerDefinition . Enable )
{
@ -75,7 +75,7 @@ namespace Readarr.Api.V1
[RestPutById]
public ActionResult < TProviderResource > UpdateProvider ( [ FromBody ] TProviderResource providerResource , [ FromQuery ] bool forceSave = false )
{
var providerDefinition = GetDefinition ( providerResource , true , fals e, false ) ;
var providerDefinition = GetDefinition ( providerResource , true , ! forceSav e, false ) ;
// Only test existing definitions if it is enabled and forceSave isn't set.
if ( providerDefinition . Enable & & ! forceSave )
@ -191,12 +191,7 @@ namespace Readarr.Api.V1
protected void VerifyValidationResult ( ValidationResult validationResult , bool includeWarnings )
{
var result = validationResult as NzbDroneValidationResult ;
if ( result = = null )
{
result = new NzbDroneValidationResult ( validationResult . Errors ) ;
}
var result = validationResult as NzbDroneValidationResult ? ? new NzbDroneValidationResult ( validationResult . Errors ) ;
if ( includeWarnings & & ( ! result . IsValid | | result . HasWarnings ) )
{