Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Kentico/community-portal
Browse files Browse the repository at this point in the history
  • Loading branch information
seangwright committed Sep 6, 2024
2 parents 23f9a3b + e96d5e9 commit 6ff0171
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,23 @@ public async Task<IActionResult> CreateQuestion(QAndAQuestionFormSubmissionViewM
var questionsParent = await mediator.Send(new QAndAQuestionsRootPageQuery(channelContext.WebsiteChannelName));
var questionMonthFolder = await mediator.Send(new QAndAMonthFolderQuery(questionsParent, channelContext.WebsiteChannelName, now.Year, now.Month, channelContext.WebsiteChannelID));

return await mediator.Send(new QAndAQuestionCreateCommand(
var result = await mediator.Send(new QAndAQuestionCreateCommand(
member,
questionMonthFolder,
channelContext.WebsiteChannelID,
requestModel.Title,
requestModel.Content,
SystemTaxonomies.QAndADiscussionTypeTaxonomy.QuestionTag.GUID,
Maybe<BlogPostPage>.None))
.Match(_ =>
{
Response.Htmx(h => h.Redirect("/q-and-a"));
Maybe<BlogPostPage>.None));

return Ok();
}, LogAndReturnError("CREATE_QUESTION"));
if (result.IsSuccess)
{
return PartialView("~/Features/QAndA/Components/Form/QAndAQuestionFormConfirmation.cshtml");
}
else
{
return LogAndReturnError("CREATE_QUESTION")(result.Error);
}
}

[HttpPost]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="alert alert-success" role="alert">
Your question has been successfully submitted!<br><br>
It may take a few moments for the <a href="/q-and-a">Q&A listing</a> to update, don't worry if you don't see it
right away.
</div>

0 comments on commit 6ff0171

Please sign in to comment.