|
|
@ -33,8 +33,8 @@ namespace Squidex.Domain.Apps.Entities.Apps.Templates |
|
|
public Task HandleAsync(CommandContext context, Func<Task> next) |
|
|
public Task HandleAsync(CommandContext context, Func<Task> next) |
|
|
{ |
|
|
{ |
|
|
if (context.IsCompleted && |
|
|
if (context.IsCompleted && |
|
|
context.Command is CreateApp createApp && |
|
|
context.Command is global::Squidex.Domain.Apps.Entities.Apps.Commands.CreateApp createApp && |
|
|
string.Equals(createApp.Template, TemplateName, StringComparison.OrdinalIgnoreCase)) |
|
|
IsRightTemplate(createApp)) |
|
|
{ |
|
|
{ |
|
|
var appId = new NamedId<Guid>(createApp.AppId, createApp.Name); |
|
|
var appId = new NamedId<Guid>(createApp.AppId, createApp.Name); |
|
|
|
|
|
|
|
|
@ -54,6 +54,11 @@ namespace Squidex.Domain.Apps.Entities.Apps.Templates |
|
|
return TaskHelper.Done; |
|
|
return TaskHelper.Done; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static bool IsRightTemplate(CreateApp createApp) |
|
|
|
|
|
{ |
|
|
|
|
|
return string.Equals(createApp.Template, TemplateName, StringComparison.OrdinalIgnoreCase); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private static async Task CreateClientAsync(Func<AppCommand, Task> publishAsync, NamedId<Guid> appId) |
|
|
private static async Task CreateClientAsync(Func<AppCommand, Task> publishAsync, NamedId<Guid> appId) |
|
|
{ |
|
|
{ |
|
|
await publishAsync(new AttachClient { Id = "sample-client" }); |
|
|
await publishAsync(new AttachClient { Id = "sample-client" }); |
|
|
|