diff --git a/Knots/Endpoints/Discussion/CreateGroupDiscussionEndpoint.cs b/Knots/Endpoints/Discussion/CreateGroupDiscussionEndpoint.cs index 5bd464b..fd85386 100644 --- a/Knots/Endpoints/Discussion/CreateGroupDiscussionEndpoint.cs +++ b/Knots/Endpoints/Discussion/CreateGroupDiscussionEndpoint.cs @@ -41,26 +41,9 @@ public class CreateGroupDiscussionEndpoint(KnotsDbContext db) : Endpoint new GroupUser { UserId = t.Id }) - .Append(new GroupUser { UserId = currentUserId }) - .ToList() - }; - - db.Groups.Add(group); - await db.SaveChangesAsync(ct); // group.Id disponible - - // 2. Créer la discussion avec le GroupId Models.Discussion discussion = new() { IsGroup = true, - GroupId = group.Id, UserDiscussions = targets .Select(t => new UserDiscussion { UserId = t.Id }) .Append(new UserDiscussion { UserId = currentUserId }) @@ -70,8 +53,23 @@ public class CreateGroupDiscussionEndpoint(KnotsDbContext db) : Endpoint new GroupUser { UserId = t.Id }) + .Append(new GroupUser { UserId = currentUserId }) + .ToList() + }; + + db.Groups.Add(group); + await db.SaveChangesAsync(ct); // group.Id disponible + + + discussion.GroupId = group.Id; await db.SaveChangesAsync(ct); await SendOkAsync(new GetDiscussionDto diff --git a/Knots/bin/Debug/net8.0/Knots.dll b/Knots/bin/Debug/net8.0/Knots.dll index 94203fd..757337a 100644 Binary files a/Knots/bin/Debug/net8.0/Knots.dll and b/Knots/bin/Debug/net8.0/Knots.dll differ diff --git a/Knots/bin/Debug/net8.0/Knots.exe b/Knots/bin/Debug/net8.0/Knots.exe index eeb4ee1..62fe9f5 100644 Binary files a/Knots/bin/Debug/net8.0/Knots.exe and b/Knots/bin/Debug/net8.0/Knots.exe differ diff --git a/Knots/bin/Debug/net8.0/Knots.pdb b/Knots/bin/Debug/net8.0/Knots.pdb index 97574ec..d946266 100644 Binary files a/Knots/bin/Debug/net8.0/Knots.pdb and b/Knots/bin/Debug/net8.0/Knots.pdb differ diff --git a/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs b/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs index 41493c7..bbcf5b1 100644 --- a/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs +++ b/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Knots")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4e06dc5f235e9c9c699b247eb56dccf3eeed81f8")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f1cdc5de19a96d553f0eaf2fbe65392602c54f85")] [assembly: System.Reflection.AssemblyProductAttribute("Knots")] [assembly: System.Reflection.AssemblyTitleAttribute("Knots")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache b/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache index d24a3eb..5a32b3c 100644 --- a/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache +++ b/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache @@ -1 +1 @@ -45989a1b023b2a60770db7a1baceef9c56c487cca0e44ae9d0d75cdde668b8cc +0618e480c1221c208fb53c91259f81c85675af45b5772bccc9fee873e927c02b diff --git a/Knots/obj/Debug/net8.0/Knots.dll b/Knots/obj/Debug/net8.0/Knots.dll index 94203fd..757337a 100644 Binary files a/Knots/obj/Debug/net8.0/Knots.dll and b/Knots/obj/Debug/net8.0/Knots.dll differ diff --git a/Knots/obj/Debug/net8.0/Knots.pdb b/Knots/obj/Debug/net8.0/Knots.pdb index 97574ec..d946266 100644 Binary files a/Knots/obj/Debug/net8.0/Knots.pdb and b/Knots/obj/Debug/net8.0/Knots.pdb differ diff --git a/Knots/obj/Debug/net8.0/apphost.exe b/Knots/obj/Debug/net8.0/apphost.exe index eeb4ee1..62fe9f5 100644 Binary files a/Knots/obj/Debug/net8.0/apphost.exe and b/Knots/obj/Debug/net8.0/apphost.exe differ diff --git a/Knots/obj/Debug/net8.0/ref/Knots.dll b/Knots/obj/Debug/net8.0/ref/Knots.dll index ff20eee..5e341dc 100644 Binary files a/Knots/obj/Debug/net8.0/ref/Knots.dll and b/Knots/obj/Debug/net8.0/ref/Knots.dll differ diff --git a/Knots/obj/Debug/net8.0/refint/Knots.dll b/Knots/obj/Debug/net8.0/refint/Knots.dll index ff20eee..5e341dc 100644 Binary files a/Knots/obj/Debug/net8.0/refint/Knots.dll and b/Knots/obj/Debug/net8.0/refint/Knots.dll differ