Browse Source

Added field rules support for CLI sync in command (#728)

Co-authored-by: Jagat Varshney <jagat.varshney@nagarro.com>
pull/729/head
Jagat 5 years ago
committed by GitHub
parent
commit
2c57d3bb48
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/UpsertSchemaDto.cs

17
backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/UpsertSchemaDto.cs

@ -45,6 +45,11 @@ namespace Squidex.Areas.Api.Controllers.Schemas.Models
/// </summary> /// </summary>
public ImmutableDictionary<string, string>? PreviewUrls { get; set; } public ImmutableDictionary<string, string>? PreviewUrls { get; set; }
/// <summary>
/// The optional field Rules.
/// </summary>
public List<FieldRuleDto>? FieldRules { get; set; }
/// <summary> /// <summary>
/// The category. /// The category.
/// </summary> /// </summary>
@ -113,6 +118,18 @@ namespace Squidex.Areas.Api.Controllers.Schemas.Models
command.Fields = fields.ToArray(); command.Fields = fields.ToArray();
} }
if (dto.FieldRules?.Count > 0)
{
var fieldRuleCommands = new List<FieldRuleCommand>();
foreach (var fieldRule in dto.FieldRules)
{
fieldRuleCommands.Add(fieldRule.ToCommand());
}
command.FieldRules = fieldRuleCommands.ToArray();
}
return command; return command;
} }
} }

Loading…
Cancel
Save