Exemplo n.º 1
0
        private async Task <HttpResponse> HandleDialogSubmission(HttpContext context, DialogSubmission dialog)
        {
            var errors = (await _dialogSubmissionHandler.Handle(dialog).ConfigureAwait(false))?.ToList()
                         ?? new List <DialogError>();

            return(errors.Any()
                ? await context.Respond(HttpStatusCode.OK, "application/json", Serialize(new DialogErrorResponse {
                Errors = errors
            })).ConfigureAwait(false)
                : await context.Respond(HttpStatusCode.OK).ConfigureAwait(false));
        }
Exemplo n.º 2
0
        private async Task <SlackResult> HandleDialogSubmission(DialogSubmission dialog)
        {
            var errors = (await _dialogSubmissionHandler.Handle(dialog).ConfigureAwait(false))?.ToList()
                         ?? new List <DialogError>();

            var body = new DialogErrorResponse {
                Errors = errors
            };

            return(errors.Any()
                ? (SlackResult) new JsonResult(_jsonSettings, HttpStatusCode.OK, body)
                : new EmptyResult(HttpStatusCode.OK));
        }