Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ public WeatherForecastController(ILogger<WeatherForecastController> logger, IMed
}

[HttpGet]
[AllowAnonymous]
public async Task<OperationResult<Tag>> Get([FromQuery] GetTagByIdQuery getTagByIdQuery)
{
return await _mediator.Send(getTagByIdQuery);
}

[HttpPost]
[AllowAnonymous]
public async Task<OperationResult> Add([FromBody] AddTagCommand addTagCommand)
{
return await _mediator.Send(addTagCommand);
Expand Down
3 changes: 3 additions & 0 deletions server/StudySharp.API/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"ConnectionStrings": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert these changes. Remember that this config overrides appsettings.json so Heroku will try to use local non existing database

"Default": "User ID=postgres;Password=Kotofey_486;Host=localhost;Port=5432;Database=StudySharp"
},
"Logging": {
"LogLevel": {
"Default": "Information",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace StudySharp.ApplicationServices.Commands
public sealed class AddTagCommand : IRequest<OperationResult>
{
public string Name { get; set; }
public int? Id { get; set; }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about nullable ids?

}

public sealed class AddTagCommandHandler : IRequestHandler<AddTagCommand, OperationResult>
Expand Down
Loading