Skip to content

Commit

Permalink
Fixed error in book publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
umerfaruk committed Sep 6, 2024
1 parent ecdc54d commit c2bc78d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/Inshapardaz.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
builder.Host.UseSerilog((ctx, cfg) =>
{
var config = cfg.Enrich.WithProperty("Application", serviceName)
.Enrich.WithProperty("Environment", ctx.HostingEnvironment.EnvironmentName)
.WriteTo.Console(new RenderedCompactJsonFormatter());
.Enrich.WithProperty("Environment", ctx.HostingEnvironment.EnvironmentName);
if (!string.IsNullOrEmpty(ctx.Configuration["elk"]))
{
config.WriteTo.Console(new RenderedCompactJsonFormatter());
config.WriteTo.Elasticsearch(new[] { new Uri(ctx.Configuration["elk"]) }, opts =>
{
opts.BootstrapMethod = BootstrapMethod.Failure;
Expand All @@ -64,6 +64,10 @@
// transport.Authentication(new ApiKey(base64EncodedApiKey)); // ApiKey
});
}
else
{
config.WriteTo.Console();
}
});

//--------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@

namespace Inshapardaz.Domain.Ports.Command.Library.Book;

public class PublishBookRequest : RequestBase
public class PublishBookRequest : LibraryBaseCommand
{
public PublishBookRequest(int libraryId, int bookId)
public PublishBookRequest(int libraryId, int bookId) : base(libraryId)
{
LibraryId = libraryId;
BookId = bookId;
}

public string Result { get; set; }
public int LibraryId { get; }
public int BookId { get; }
}

Expand Down

0 comments on commit c2bc78d

Please sign in to comment.