Browse Source

Filter out deleted assets.

pull/214/head
Sebastian Stehle 8 years ago
parent
commit
9177431b08
  1. 4
      src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs

4
src/Squidex.Domain.Apps.Entities.MongoDb/Assets/MongoAssetRepository.cs

@ -38,6 +38,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Assets
return collection.Indexes.CreateOneAsync( return collection.Indexes.CreateOneAsync(
Index Index
.Ascending(x => x.State.AppId) .Ascending(x => x.State.AppId)
.Ascending(x => x.State.IsDeleted)
.Ascending(x => x.State.FileName) .Ascending(x => x.State.FileName)
.Ascending(x => x.State.MimeType) .Ascending(x => x.State.MimeType)
.Descending(x => x.State.LastModified)); .Descending(x => x.State.LastModified));
@ -90,7 +91,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Assets
{ {
var filters = new List<FilterDefinition<MongoAssetEntity>> var filters = new List<FilterDefinition<MongoAssetEntity>>
{ {
Filter.Eq(x => x.State.AppId, appId) Filter.Eq(x => x.State.AppId, appId),
Filter.Eq(x => x.State.IsDeleted, false)
}; };
if (ids != null && ids.Count > 0) if (ids != null && ids.Count > 0)

Loading…
Cancel
Save