Files
mixtape/zero.Web/Controllers/TranslationsController.cs
T

26 lines
863 B
C#
Raw Normal View History

2020-05-04 14:13:03 +02:00
using Microsoft.AspNetCore.Mvc;
using Raven.Client.Documents.Linq;
using System.Linq;
2020-05-04 14:13:03 +02:00
using System.Threading.Tasks;
using zero.Core.Collections;
2020-05-04 14:13:03 +02:00
using zero.Core.Entities;
using zero.Core.Extensions;
2020-05-04 14:13:03 +02:00
using zero.Core.Identity;
namespace zero.Web.Controllers
{
[ZeroAuthorize(Permissions.Settings.Translations, PermissionsValue.Read)]
public class TranslationsController : BackofficeCollectionController<ITranslation, ITranslationsCollection>
2020-05-04 14:13:03 +02:00
{
public TranslationsController(ITranslationsCollection collection) : base(collection)
2020-05-04 14:13:03 +02:00
{
}
public override async Task<ListResult<ITranslation>> GetByQuery([FromQuery] ListBackofficeQuery<ITranslation> query)
{
query.SearchFor(entity => entity.Key, entity => entity.Value);
return await Collection.Query.OrderByDescending(x => x.CreatedDate).ToQueriedListAsync(query);
}
2020-05-04 14:13:03 +02:00
}
}