From 88c6857e24b2585ebe54f47408c09f7f2cdef9e1 Mon Sep 17 00:00:00 2001 From: Christian Werner Date: Wed, 29 Oct 2025 13:40:13 +0100 Subject: [PATCH] fix master relations not being set --- .../Services/InitService.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs b/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs index 08eaab1..ee0ec57 100644 --- a/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs +++ b/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs @@ -131,6 +131,7 @@ public class InitService Name = "Master", IsMaster = true, OwnerId = housemasterUser.Id!.Value, + Subjects = [housemasterUser] }; _applicationContext.Tenants.Add(masterTenant); @@ -141,21 +142,14 @@ public class InitService Visibility = EntityVisibility.Active, TenantId = masterTenant.Id!.Value, Name = "Master", - BaseAddress = baseAddress + BaseAddress = baseAddress, + Tenant = masterTenant, + Subjects = [housemasterUser] }; _applicationContext.Apps.Add(masterApp); await _applicationContext.SaveChangesAsync(); - var appSubjectRelation = new AppSubjectRelationEntity - { - AppId = masterApp.Id!.Value, - SubjectId = housemasterUser.Id!.Value - }; - - _applicationContext.AppSubjectRelations.Add(appSubjectRelation); - await _applicationContext.SaveChangesAsync(); - _logger.LogInformation($""" ----- Housemaster initial login information ----- username: {housemasterUser.Name}