Example #1
0
        public HttpResponseMessage Post([FromBody] CreateDataProcessingRegistrationDTO dto)
        {
            if (dto == null)
            {
                return(BadRequest("No input parameters provided"));
            }

            return(_dataProcessingRegistrationApplicationService
                   .Create(dto.OrganizationId, dto.Name)
                   .Match(value => Created(ToDTO(value), new Uri(Request.RequestUri + "/" + value.Id)), FromOperationError));
        }
        public static async Task <HttpResponseMessage> SendCreateRequestAsync(int organizationId, string name, Cookie optionalLogin = null)
        {
            var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.GlobalAdmin);

            var body = new CreateDataProcessingRegistrationDTO
            {
                Name           = name,
                OrganizationId = organizationId
            };

            return(await HttpApi.PostWithCookieAsync(TestEnvironment.CreateUrl($"api/v1/data-processing-registration"), cookie, body));
        }