From d169566cd1ac61ac678331150de15534c2311c0a Mon Sep 17 00:00:00 2001 From: sbouaram Date: Mon, 24 Apr 2023 05:36:57 -0400 Subject: [PATCH] administration create group --- handlers/application/administration.go | 31 +++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/handlers/application/administration.go b/handlers/application/administration.go index 58040c0..15b93a5 100755 --- a/handlers/application/administration.go +++ b/handlers/application/administration.go @@ -160,22 +160,23 @@ func (h *ApplicationHandler) AdministrationCreateGroup(w http.ResponseWriter, r Namespace: "parcoursmob_roles", }, } - - _, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_organization) - if err != nil { - fmt.Println(err) - w.WriteHeader(http.StatusInternalServerError) - return - } - + go func() { + _, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_organization) + if err != nil { + fmt.Println(err) + w.WriteHeader(http.StatusInternalServerError) + return + } + }() // Create the admin role for the organization - _, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_role) - if err != nil { - fmt.Println(err) - w.WriteHeader(http.StatusInternalServerError) - return - } - + go func() { + _, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_role) + if err != nil { + fmt.Println(err) + w.WriteHeader(http.StatusInternalServerError) + return + } + }() http.Redirect(w, r, fmt.Sprintf("/app/administration/groups/%s", groupid), http.StatusFound) return }