GoldenEye icon indicating copy to clipboard operation
GoldenEye copied to clipboard

POST/Issues doesn't return something

Open AndiRudi opened this issue 4 years ago • 0 comments

I just saw, that the POST to create a new issue does not return the generated Issue. I understand that from a CQRS perspective this is ok-ish, but from a Frontend Developers perspective it does not make sense to create a new issue and then not getting the created resources. So I wanted to change it like that:

var issueId = await commandBus.SendAsync(command);
return Ok(await queryBus.SendAsync<GetIssue, IssueView>(new GetIssue(issueId)));

or maybe like this

await commandBus.SendAsync(command);
return Ok(await queryBus.SendAsync<GetIssue, IssueView>(new GetIssue(command.Id)));

I read some articles explaining that the second concept might be ok, what do you think?

AndiRudi avatar Dec 20 '20 17:12 AndiRudi