Skip to content

Commit

Permalink
fix: Add verification for local clone (#14793)
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad-Simso authored Feb 25, 2025
1 parent 8848440 commit 8389beb
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Altinn.Studio.Designer.Helpers;
using Altinn.Studio.Designer.Models;
using Altinn.Studio.Designer.Models.Dto;
using Altinn.Studio.Designer.Services.Interfaces;
using Altinn.Studio.Designer.Services.Interfaces.Organisation;
using LibGit2Sharp;
using Microsoft.AspNetCore.Authorization;
Expand All @@ -22,14 +23,17 @@ namespace Altinn.Studio.Designer.Controllers.Organisation;
public class OrgCodeListController : ControllerBase
{
private readonly IOrgCodeListService _orgCodeListService;
private readonly ISourceControl _sourceControl;

/// <summary>
/// Initializes a new instance of the <see cref="OrgCodeListController"/> class.
/// </summary>
/// <param name="orgCodeListService">The CodeList service for organisation level</param>
public OrgCodeListController(IOrgCodeListService orgCodeListService)
/// <param name="sourceControl">The source control service.</param>
public OrgCodeListController(IOrgCodeListService orgCodeListService, ISourceControl sourceControl)
{
_orgCodeListService = orgCodeListService;
_sourceControl = sourceControl;
}

/// <summary>
Expand All @@ -44,6 +48,7 @@ public async Task<ActionResult<List<OptionListData>>> GetCodeLists(string org, C
{
try
{
await _sourceControl.VerifyCloneExists(org, $"{org}-content");
string developer = AuthenticationHelper.GetDeveloperUserName(HttpContext);

List<OptionListData> codeLists = await _orgCodeListService.GetCodeLists(org, developer, cancellationToken);
Expand Down

0 comments on commit 8389beb

Please sign in to comment.