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

Fix post instance: Use appId from query param and not from request body #635

Merged
merged 2 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Storage/Controllers/InstancesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public async Task<ActionResult<Instance>> Post(string appId, [FromBody] Instance

appId = ValidateAppId(appId);

(Application appInfo, ServiceError appInfoError) = await _applicationService.GetApplicationOrErrorAsync(instance.AppId);
(Application appInfo, ServiceError appInfoError) = await _applicationService.GetApplicationOrErrorAsync(appId);

if (appInfoError != null)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Storage/Services/ApplicationService.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Threading.Tasks;
using Altinn.Platform.Storage.Interface.Models;
using Altinn.Platform.Storage.Models;
Expand Down Expand Up @@ -45,6 +46,8 @@ public ApplicationService(IApplicationRepository applicationRepository)
/// <returns></returns>
public async Task<(Application Application, ServiceError ServiceError)> GetApplicationOrErrorAsync(string appId)
{
ArgumentException.ThrowIfNullOrWhiteSpace(appId);

ServiceError serviceError = null;

string org = appId.Split("/")[0];
Expand Down
Loading