mirror of https://github.com/Squidex/squidex.git
19 changed files with 267 additions and 111 deletions
@ -1,26 +0,0 @@ |
|||
// ==========================================================================
|
|||
// ConfigureLanguages.cs
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex Group
|
|||
// All rights reserved.
|
|||
// ==========================================================================
|
|||
|
|||
using System.Collections.Generic; |
|||
using Squidex.Infrastructure; |
|||
|
|||
namespace Squidex.Write.Apps.Commands |
|||
{ |
|||
public sealed class ConfigureLanguages : AppAggregateCommand, IValidatable |
|||
{ |
|||
public List<Language> Languages { get; set; } |
|||
|
|||
public void Validate(IList<ValidationError> errors) |
|||
{ |
|||
if (Languages == null || Languages.Count == 0) |
|||
{ |
|||
errors.Add(new ValidationError("Languages need at least one element.", nameof(Languages))); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,21 +1,22 @@ |
|||
// ==========================================================================
|
|||
// ConfigureLanguagesDto.cs
|
|||
// AddLanguageDto.cs
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex Group
|
|||
// All rights reserved.
|
|||
// ==========================================================================
|
|||
|
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Squidex.Infrastructure; |
|||
|
|||
namespace Squidex.Controllers.Api.Apps.Models |
|||
{ |
|||
public sealed class ConfigureLanguagesDto |
|||
public class AddLanguageDto |
|||
{ |
|||
/// <summary>
|
|||
/// The list of languages to configure the app.
|
|||
/// The language to add.
|
|||
/// </summary>
|
|||
public List<Language> Languages { get; set; } |
|||
[Required] |
|||
public Language Language { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
// ==========================================================================
|
|||
// SetMasterLanguageDto.cs
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex Group
|
|||
// All rights reserved.
|
|||
// ==========================================================================
|
|||
|
|||
namespace Squidex.Controllers.Api.Apps.Models |
|||
{ |
|||
public class SetMasterLanguageDto |
|||
{ |
|||
/// <summary>
|
|||
/// Set the value to true to make the language to the master language.
|
|||
/// </summary>
|
|||
public bool IsMasterLanguage { get; set; } |
|||
} |
|||
} |
|||
Loading…
Reference in new issue