This commit is contained in:
@@ -9,7 +9,7 @@ using Microsoft.Extensions.Logging;
|
||||
using AyaNova.Models;
|
||||
using AyaNova.Api.ControllerHelpers;
|
||||
using AyaNova.Biz;
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
|
||||
|
||||
@@ -148,8 +148,8 @@ namespace AyaNova.Api.Controllers
|
||||
/// </summary>
|
||||
/// <param name="requestData"></param>
|
||||
/// <returns>HTTP 204 No Content result code on success or fail code with explanation</returns>
|
||||
[HttpPost("trial")]
|
||||
public async Task<IActionResult> RequestTrial([FromBody] dtoTrialRequestData requestData)
|
||||
[HttpPost("trialrequest")]
|
||||
public async Task<IActionResult> RequestTrial([FromBody] dtoRequestTrial requestData)
|
||||
{
|
||||
if (serverState.IsClosed)
|
||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||
@@ -206,7 +206,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
|
||||
|
||||
long UserId = UserIdFromContext.Id(HttpContext.Items);
|
||||
|
||||
//SuperUser only and must have accept code
|
||||
@@ -231,14 +231,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
//------------------------------------------------------
|
||||
|
||||
public class dtoTrialRequestData
|
||||
{
|
||||
[System.ComponentModel.DataAnnotations.Required]
|
||||
public string RegisteredTo { get; set; }
|
||||
[System.ComponentModel.DataAnnotations.Required, System.ComponentModel.DataAnnotations.EmailAddress]
|
||||
public string EmailAddress { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
17
server/AyaNova/models/dto/RequestTrial.cs
Normal file
17
server/AyaNova/models/dto/RequestTrial.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace AyaNova.Models
|
||||
{
|
||||
|
||||
public class RequestTrial
|
||||
{
|
||||
[Required]
|
||||
public Guid DbId { get; set; }
|
||||
[Required, EmailAddress]
|
||||
public string Email { get; set; }
|
||||
[Required]
|
||||
public string Company { get; set; }
|
||||
[Required]
|
||||
public string Contact { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user