diff --git a/backend/src/Designer/Controllers/Organisation/OrgCodeListController.cs b/backend/src/Designer/Controllers/Organisation/OrgCodeListController.cs
index bd3e6871f30..253421405ee 100644
--- a/backend/src/Designer/Controllers/Organisation/OrgCodeListController.cs
+++ b/backend/src/Designer/Controllers/Organisation/OrgCodeListController.cs
@@ -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;
@@ -22,14 +23,17 @@ namespace Altinn.Studio.Designer.Controllers.Organisation;
public class OrgCodeListController : ControllerBase
{
private readonly IOrgCodeListService _orgCodeListService;
+ private readonly ISourceControl _sourceControl;
///
/// Initializes a new instance of the class.
///
/// The CodeList service for organisation level
- public OrgCodeListController(IOrgCodeListService orgCodeListService)
+ /// The source control service.
+ public OrgCodeListController(IOrgCodeListService orgCodeListService, ISourceControl sourceControl)
{
_orgCodeListService = orgCodeListService;
+ _sourceControl = sourceControl;
}
///
@@ -44,6 +48,7 @@ public async Task>> GetCodeLists(string org, C
{
try
{
+ await _sourceControl.VerifyCloneExists(org, $"{org}-content");
string developer = AuthenticationHelper.GetDeveloperUserName(HttpContext);
List codeLists = await _orgCodeListService.GetCodeLists(org, developer, cancellationToken);