Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST/Issues doesn't return something #83

Open
AndiRudi opened this issue Dec 20, 2020 · 0 comments
Open

POST/Issues doesn't return something #83

AndiRudi opened this issue Dec 20, 2020 · 0 comments

Comments

@AndiRudi
Copy link

AndiRudi commented Dec 20, 2020

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 AndiRudi changed the title POST/Issues does not return and Id... POST/Issues doesn't return something Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant