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

Merge conflicting discussion controller methods #18

Merged
merged 1 commit into from
Jan 30, 2024
Merged
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 @@ -22,19 +22,13 @@ public class DiscussionsController : ControllerBase
public async Task<DiscussionDto> GetDiscussionById([FromRoute] Guid discussionId) =>
await _discussions.GetByIdAsync(discussionId);

/// <summary>
/// Returns all discussions.
/// </summary>
[HttpGet]
public async Task<IEnumerable<DiscussionDto>> GetAllDiscussions() =>
await _discussions.GetAllAsync();

/// <summary>
/// Returns all discussions created by author with the specified ID.
/// </summary>
[HttpGet]
public async Task<IEnumerable<DiscussionDto>> GetDiscussionsByAuthor([FromQuery] Guid authorId) =>
await _discussions.GetByAuthorAsync(authorId);
public async Task<IEnumerable<DiscussionDto>> GetDiscussions([FromQuery] Guid? authorId) => authorId is null
? await _discussions.GetAllAsync()
: await _discussions.GetByAuthorAsync(authorId.Value);

/// <summary>
/// Creates a discussion.
Expand Down
Loading