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

Allow copied code from core to use #if LOCALTEST #64

Closed
wants to merge 2 commits into from

Conversation

ivarne
Copy link
Member

@ivarne ivarne commented Nov 15, 2023

This makes it simpler to maintain (almost) the code in multiple repositories greatly simplifying maintenance when copying changes.

        var validationResult = _validator.Validate(emailNotificationOrderRequest);
        if (!validationResult.IsValid)
        {
            validationResult.AddToModelState(this.ModelState);
             return ValidationProblem(ModelState);
         }

#if LOCALTEST
         string creator = "localtest";
#else
         string? creator = HttpContext.GetOrg();

         if (creator == null)
         {
             return Forbid();
         }
#endif

         var orderRequest = emailNotificationOrderRequest.MapToOrderRequest(creator);
         (NotificationOrder? registeredOrder, ServiceError? error) = await _orderService.RegisterEmailNotificationOrder(orderRequest);

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

This makes it simpler to maintain (almost) the code in multiple
repositories greatly simplifying maintanance when copying changes.
@ivarne ivarne closed this Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant