Browse Source

Schema fix.

pull/674/head
Sebastian 5 years ago
parent
commit
bfce1164ed
  1. 11
      backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetCommandMiddleware.cs
  2. 1
      backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs
  3. 1
      backend/src/Squidex.Domain.Apps.Entities/Contents/Schemas/ContentJsonSchemaBuilder.cs

11
backend/src/Squidex.Domain.Apps.Entities/Assets/DomainObject/AssetCommandMiddleware.cs

@ -203,13 +203,18 @@ namespace Squidex.Domain.Apps.Entities.Assets.DomainObject
{
await assetFileStore.UploadAsync(tempFile, hashStream);
var hash = $"{hashStream.GetHashStringAndReset()}{command.File.FileName}{command.File.FileSize}".Sha256Base64();
command.FileHash = hash;
command.FileHash = ComputeHash(command.File, hashStream);
}
}
}
private static string ComputeHash(AssetFile file, HasherStream hashStream)
{
var steamHash = hashStream.GetHashStringAndReset();
return $"{steamHash}{file.FileName}{file.FileSize}".Sha256Base64();
}
private async Task EnrichWithMetadataAsync(UploadAssetCommand command)
{
foreach (var metadataSource in assetMetadataSources)

1
backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/ContentQueryParser.cs

@ -293,7 +293,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.Queries
if (schemaType != null)
{
entityType.AddStructuralProperty("data", new EdmComplexTypeReference(schemaType, false));
entityType.AddStructuralProperty("dataDraft", new EdmComplexTypeReference(schemaType, false));
model.AddElement(schemaType);
}

1
backend/src/Squidex.Domain.Apps.Entities/Contents/Schemas/ContentJsonSchemaBuilder.cs

@ -44,7 +44,6 @@ namespace Squidex.Domain.Apps.Core.GenerateJsonSchema
if (dataSchema != null)
{
jsonSchema.Properties["data"] = SchemaBuilder.ReferenceProperty(dataSchema, $"The data of the {name}.", true);
jsonSchema.Properties["dataDraft"] = SchemaBuilder.ReferenceProperty(dataSchema, $"The draft data of the {name}.");
}
return jsonSchema;

Loading…
Cancel
Save