diff --git a/internal/models/faqs.go b/internal/models/faqs.go index 18dff33a..33dc9c18 100644 --- a/internal/models/faqs.go +++ b/internal/models/faqs.go @@ -13,7 +13,7 @@ type FAQ struct { ID string `gorm:"primaryKey;type:uuid" json:"id"` Question string `gorm:"type:varchar(225);not null" json:"question" validate:"required"` Answer string `gorm:"type:text;not null" json:"answer" validate:"required"` - Category string `gorm:"type:varchar(30);not null" json:"category" validate:"required"` + Category string `gorm:"type:varchar(30);null" json:"category" validate:"required"` CreatedAt time.Time `gorm:"column:created_at; not null; autoCreateTime" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at; null; autoUpdateTime" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` diff --git a/internal/models/superadmin.go b/internal/models/superadmin.go index b96d4dca..35efd0d7 100644 --- a/internal/models/superadmin.go +++ b/internal/models/superadmin.go @@ -31,9 +31,9 @@ type Language struct { type Timezone struct { ID string `gorm:"type:uuid;primary_key" json:"timezone_id"` - Timezone string `gorm:"type:varchar(40);unique;not null" json:"timezone" validate:"required"` - GmtOffset string `gorm:"type:varchar(20);unique;not null" json:"gmt_offset" validate:"required"` - Description string `gorm:"type:varchar(100);not null" json:"description" validate:"required"` + Timezone string `gorm:"type:varchar(40);unique;null" json:"timezone" validate:"required"` + GmtOffset string `gorm:"type:varchar(20);unique;null" json:"gmt_offset" validate:"required"` + Description string `gorm:"type:varchar(100);null" json:"description" validate:"required"` CreatedAt time.Time `gorm:"column:created_at;not null;autoCreateTime" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at;not null;autoUpdateTime" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` diff --git a/pkg/router/organisation.go b/pkg/router/organisation.go index b9f5fb5c..7bec232f 100644 --- a/pkg/router/organisation.go +++ b/pkg/router/organisation.go @@ -20,23 +20,23 @@ func Organisation(r *gin.Engine, ApiVersion string, validator *validator.Validat organisationUrl := r.Group(fmt.Sprintf("%v", ApiVersion), middleware.Authorize(db.Postgresql, models.RoleIdentity.SuperAdmin, models.RoleIdentity.User)) { - organisationUrl.POST("/organizations", organisation.CreateOrganisation) - organisationUrl.GET("/organizations/:org_id", organisation.GetOrganisation) - organisationUrl.DELETE("/organizations/:org_id", organisation.DeleteOrganisation) - organisationUrl.PATCH("/organizations/:org_id", organisation.UpdateOrganisation) - organisationUrl.GET("/organizations/:org_id/users", organisation.GetUsersInOrganisation) - organisationUrl.POST("/organizations/:org_id/roles", organisation.CreateOrgRole) - organisationUrl.GET("/organizations/:org_id/roles", organisation.GetOrgRoles) - organisationUrl.GET("/organizations/:org_id/roles/:role_id", organisation.GetAOrgRole) - organisationUrl.DELETE("/organizations/:org_id/roles/:role_id", organisation.DeleteOrgRole) - organisationUrl.PATCH("/organizations/:org_id/roles/:role_id", organisation.UpdateOrgRole) - organisationUrl.PATCH("/organizations/:org_id/roles/:role_id/permissions", organisation.UpdateOrgPermissions) + organisationUrl.POST("/organisations", organisation.CreateOrganisation) + organisationUrl.GET("/organisations/:org_id", organisation.GetOrganisation) + organisationUrl.DELETE("/organisations/:org_id", organisation.DeleteOrganisation) + organisationUrl.PATCH("/organisations/:org_id", organisation.UpdateOrganisation) + organisationUrl.GET("/organisations/:org_id/users", organisation.GetUsersInOrganisation) + organisationUrl.POST("/organisations/:org_id/roles", organisation.CreateOrgRole) + organisationUrl.GET("/organisations/:org_id/roles", organisation.GetOrgRoles) + organisationUrl.GET("/organisations/:org_id/roles/:role_id", organisation.GetAOrgRole) + organisationUrl.DELETE("/organisations/:org_id/roles/:role_id", organisation.DeleteOrgRole) + organisationUrl.PATCH("/organisations/:org_id/roles/:role_id", organisation.UpdateOrgRole) + organisationUrl.PATCH("/organisations/:org_id/roles/:role_id/permissions", organisation.UpdateOrgPermissions) } organisationUrlSec := r.Group(fmt.Sprintf("%v", ApiVersion), middleware.Authorize(db.Postgresql, models.RoleIdentity.SuperAdmin)) { - organisationUrlSec.POST("/organizations/:org_id/users", organisation.AddUserToOrganisation) + organisationUrlSec.POST("/organisations/:org_id/users", organisation.AddUserToOrganisation) } return r } diff --git a/static/swagger.yaml b/static/swagger.yaml index 6b576757..95e381f1 100644 --- a/static/swagger.yaml +++ b/static/swagger.yaml @@ -4463,7 +4463,7 @@ paths: security: - bearerAuth: [] - /api/v1/notifications: + /notifications/global: post: tags: - notifications @@ -4556,6 +4556,7 @@ paths: security: - bearerAuth: [] + /notifications/all: get: tags: - notifications @@ -4639,7 +4640,7 @@ paths: security: - bearerAuth: [] - /api/v1/notifications/: + /notifications/unread: get: tags: - notifications @@ -4730,13 +4731,13 @@ paths: security: - bearerAuth: [] - /api/v1/notifications/{notification_id}: + /notifications/{notification_id}: patch: tags: - notifications summary: Mark a notification as read parameters: - - name: notification_id + - name: notificationId in: path required: true schema: @@ -4920,7 +4921,7 @@ paths: security: - bearerAuth: [] - /api/v1/notification-settings: + /settings/notification-settings: patch: tags: - notification_settings diff --git a/tests/test_organisation/base.go b/tests/test_organisation/base.go index 8c28d246..bd1f1cfa 100644 --- a/tests/test_organisation/base.go +++ b/tests/test_organisation/base.go @@ -72,10 +72,10 @@ func SetupOrgRoutes(r *gin.Engine, orgController *organisation.Controller) { orgUrl := r.Group("/api/v1", middleware.Authorize(orgController.Db.Postgresql, models.RoleIdentity.SuperAdmin, models.RoleIdentity.User)) - orgUrl.POST("/organizations/:org_id/roles", orgController.CreateOrgRole) - orgUrl.GET("/organizations/:org_id/roles", orgController.GetOrgRoles) - orgUrl.GET("/organizations/:org_id/roles/:role_id", orgController.GetAOrgRole) - orgUrl.DELETE("/organizations/:org_id/roles/:role_id", orgController.DeleteOrgRole) - orgUrl.PATCH("/organizations/:org_id/roles/:role_id", orgController.UpdateOrgRole) - orgUrl.PATCH("/organizations/:org_id/roles/:role_id/permissions", orgController.UpdateOrgPermissions) + orgUrl.POST("/organisations/:org_id/roles", orgController.CreateOrgRole) + orgUrl.GET("/organisations/:org_id/roles", orgController.GetOrgRoles) + orgUrl.GET("/organisations/:org_id/roles/:role_id", orgController.GetAOrgRole) + orgUrl.DELETE("/organisations/:org_id/roles/:role_id", orgController.DeleteOrgRole) + orgUrl.PATCH("/organisations/:org_id/roles/:role_id", orgController.UpdateOrgRole) + orgUrl.PATCH("/organisations/:org_id/roles/:role_id/permissions", orgController.UpdateOrgPermissions) } diff --git a/tests/test_organisation/create_roles_test.go b/tests/test_organisation/create_roles_test.go index 5b5e53d4..d502e1a2 100644 --- a/tests/test_organisation/create_roles_test.go +++ b/tests/test_organisation/create_roles_test.go @@ -76,7 +76,7 @@ func TestCreateOrgRole(t *testing.T) { } roleJSON, _ := json.Marshal(role) - req, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("/api/v1/organizations/%s/roles", orgID), bytes.NewBuffer(roleJSON)) + req, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("/api/v1/organisations/%s/roles", orgID), bytes.NewBuffer(roleJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -97,7 +97,7 @@ func TestCreateOrgRole(t *testing.T) { } roleJSON, _ := json.Marshal(role) - req, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("/api/v1/organizations/%s/roles", orgID), bytes.NewBuffer(roleJSON)) + req, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("/api/v1/organisations/%s/roles", orgID), bytes.NewBuffer(roleJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer invalid_token") @@ -125,7 +125,7 @@ func TestCreateOrgRole(t *testing.T) { } roleJSON, _ := json.Marshal(role) - req, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("/api/v1/organizations/%s/roles", orgID), bytes.NewBuffer(roleJSON)) + req, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("/api/v1/organisations/%s/roles", orgID), bytes.NewBuffer(roleJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -152,7 +152,7 @@ func TestCreateOrgRole(t *testing.T) { } roleJSON, _ := json.Marshal(role) - req, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("/api/v1/organizations/%s/roles", orgID), bytes.NewBuffer(roleJSON)) + req, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("/api/v1/organisations/%s/roles", orgID), bytes.NewBuffer(roleJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) diff --git a/tests/test_organisation/delete_roles_test.go b/tests/test_organisation/delete_roles_test.go index 3d0c6803..c8d6f63e 100644 --- a/tests/test_organisation/delete_roles_test.go +++ b/tests/test_organisation/delete_roles_test.go @@ -79,7 +79,7 @@ func TestDeleteOrgRole(t *testing.T) { } token := tests.GetLoginToken(t, router, *orgController, loginData) - req, _ := http.NewRequest(http.MethodDelete, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, roleID), nil) + req, _ := http.NewRequest(http.MethodDelete, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, roleID), nil) req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) resp := httptest.NewRecorder() @@ -93,7 +93,7 @@ func TestDeleteOrgRole(t *testing.T) { t.Run("Unauthorized Access", func(t *testing.T) { router, _ := setup() - req, _ := http.NewRequest(http.MethodDelete, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, roleID), nil) + req, _ := http.NewRequest(http.MethodDelete, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, roleID), nil) req.Header.Set("Authorization", "Bearer invalid_token") resp := httptest.NewRecorder() @@ -113,7 +113,7 @@ func TestDeleteOrgRole(t *testing.T) { } token := tests.GetLoginToken(t, router, *orgController, loginData) - req, _ := http.NewRequest(http.MethodDelete, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, roleID), nil) + req, _ := http.NewRequest(http.MethodDelete, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, roleID), nil) req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) resp := httptest.NewRecorder() @@ -135,7 +135,7 @@ func TestDeleteOrgRole(t *testing.T) { nonExistentRoleID := utility.GenerateUUID() - req, _ := http.NewRequest(http.MethodDelete, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, nonExistentRoleID), nil) + req, _ := http.NewRequest(http.MethodDelete, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, nonExistentRoleID), nil) req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) resp := httptest.NewRecorder() diff --git a/tests/test_organisation/get_roles_test.go b/tests/test_organisation/get_roles_test.go index febd822f..3b060dca 100644 --- a/tests/test_organisation/get_roles_test.go +++ b/tests/test_organisation/get_roles_test.go @@ -87,7 +87,7 @@ func TestGetOrgRoles(t *testing.T) { } token := tests.GetLoginToken(t, router, *orgController, loginData) - req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organizations/%s/roles", orgID), nil) + req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organisations/%s/roles", orgID), nil) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -102,7 +102,7 @@ func TestGetOrgRoles(t *testing.T) { t.Run("Unauthorized Access", func(t *testing.T) { router, _ := setup() - req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organizations/%s/roles", orgID), nil) + req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organisations/%s/roles", orgID), nil) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer invalid_token") @@ -123,7 +123,7 @@ func TestGetOrgRoles(t *testing.T) { } token := tests.GetLoginToken(t, router, *orgController, loginData) - req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organizations/%s/roles", orgID), nil) + req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organisations/%s/roles", orgID), nil) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -202,7 +202,7 @@ func TestGetAOrgRole(t *testing.T) { } token := tests.GetLoginToken(t, router, *orgController, loginData) - req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, roleID), nil) + req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, roleID), nil) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -217,7 +217,7 @@ func TestGetAOrgRole(t *testing.T) { t.Run("Unauthorized Access", func(t *testing.T) { router, _ := setup() - req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, roleID), nil) + req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, roleID), nil) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer invalid_token") @@ -238,7 +238,7 @@ func TestGetAOrgRole(t *testing.T) { } token := tests.GetLoginToken(t, router, *orgController, loginData) - req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, roleID), nil) + req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, roleID), nil) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) diff --git a/tests/test_organisation/organisation_test.go b/tests/test_organisation/organisation_test.go index 8d037b52..2ce20da4 100644 --- a/tests/test_organisation/organisation_test.go +++ b/tests/test_organisation/organisation_test.go @@ -27,7 +27,7 @@ func TestOrganizationCreate(t *testing.T) { validatorRef := validator.New() db := storage.Connection() - requestURI := url.URL{Path: "/api/v1/organizations"} + requestURI := url.URL{Path: "/api/v1/organisations"} currUUID := utility.GenerateUUID() userSignUpData := models.CreateUserRequestModel{ Email: fmt.Sprintf("testuser%v@qa.team", currUUID), @@ -150,7 +150,7 @@ func TestOrganizationCreate(t *testing.T) { orgUrl := r.Group(fmt.Sprintf("%v", "/api/v1"), middleware.Authorize(db.Postgresql, models.RoleIdentity.SuperAdmin, models.RoleIdentity.User)) { - orgUrl.POST("/organizations", org.CreateOrganisation) + orgUrl.POST("/organisations", org.CreateOrganisation) } @@ -246,12 +246,12 @@ func TestGetOrganisation(t *testing.T) { orgUrl := r.Group("/api/v1", middleware.Authorize(db.Postgresql, models.RoleIdentity.SuperAdmin, models.RoleIdentity.User)) { - orgUrl.GET("/organizations/:org_id", org.GetOrganisation) + orgUrl.GET("/organisations/:org_id", org.GetOrganisation) } for _, test := range tests { t.Run(test.Name, func(t *testing.T) { - req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organizations/%s", test.OrgID), nil) + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("/api/v1/organisations/%s", test.OrgID), nil) if err != nil { t.Fatal(err) } @@ -386,7 +386,7 @@ func TestOrganisationUpdate(t *testing.T) { orgUrl := r.Group("/api/v1", middleware.Authorize(db.Postgresql, models.RoleIdentity.SuperAdmin, models.RoleIdentity.User)) { - orgUrl.PATCH("/organizations/:org_id", org.UpdateOrganisation) + orgUrl.PATCH("/organisations/:org_id", org.UpdateOrganisation) } for _, test := range tests { @@ -394,7 +394,7 @@ func TestOrganisationUpdate(t *testing.T) { var b bytes.Buffer json.NewEncoder(&b).Encode(test.RequestBody) - req, err := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organizations/%s", test.OrgID), &b) + req, err := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organisations/%s", test.OrgID), &b) if err != nil { t.Fatal(err) } @@ -498,12 +498,12 @@ func TestOrganisationDelete(t *testing.T) { orgUrl := r.Group("/api/v1", middleware.Authorize(db.Postgresql, models.RoleIdentity.SuperAdmin, models.RoleIdentity.User)) { - orgUrl.DELETE("/organizations/:org_id", org.DeleteOrganisation) + orgUrl.DELETE("/organisations/:org_id", org.DeleteOrganisation) } for _, test := range tests { t.Run(test.Name, func(t *testing.T) { - req, err := http.NewRequest(http.MethodDelete, fmt.Sprintf("/api/v1/organizations/%s", test.OrgID), nil) + req, err := http.NewRequest(http.MethodDelete, fmt.Sprintf("/api/v1/organisations/%s", test.OrgID), nil) if err != nil { t.Fatal(err) } @@ -616,11 +616,11 @@ func TestGetUsersInOrg(t *testing.T) { orgUrl := r.Group(fmt.Sprintf("%v", "/api/v1"), middleware.Authorize(db.Postgresql,models.RoleIdentity.SuperAdmin, models.RoleIdentity.User)) { - orgUrl.GET("/organizations/:org_id/users", org.GetUsersInOrganisation) + orgUrl.GET("/organisations/:org_id/users", org.GetUsersInOrganisation) } t.Run(test.Name, func(t *testing.T) { - req, err := http.NewRequest(http.MethodGet,fmt.Sprintf("/api/v1/organizations/%s/users", test.OrgID), nil) + req, err := http.NewRequest(http.MethodGet,fmt.Sprintf("/api/v1/organisations/%s/users", test.OrgID), nil) if err != nil { t.Fatal(err) } diff --git a/tests/test_organisation/update_roles_test.go b/tests/test_organisation/update_roles_test.go index 9d3932a9..589714b3 100644 --- a/tests/test_organisation/update_roles_test.go +++ b/tests/test_organisation/update_roles_test.go @@ -87,7 +87,7 @@ func TestUpdateOrgRole(t *testing.T) { } roleJSON, _ := json.Marshal(updatedRole) - req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, roleID), bytes.NewBuffer(roleJSON)) + req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, roleID), bytes.NewBuffer(roleJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -108,7 +108,7 @@ func TestUpdateOrgRole(t *testing.T) { } roleJSON, _ := json.Marshal(updatedRole) - req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, roleID), bytes.NewBuffer(roleJSON)) + req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, roleID), bytes.NewBuffer(roleJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer invalid_token") @@ -135,7 +135,7 @@ func TestUpdateOrgRole(t *testing.T) { } roleJSON, _ := json.Marshal(updatedRole) - req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, roleID), bytes.NewBuffer(roleJSON)) + req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, roleID), bytes.NewBuffer(roleJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -161,7 +161,7 @@ func TestUpdateOrgRole(t *testing.T) { } roleJSON, _ := json.Marshal(invalidRole) - req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organizations/%s/roles/%s", orgID, roleID), bytes.NewBuffer(roleJSON)) + req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organisations/%s/roles/%s", orgID, roleID), bytes.NewBuffer(roleJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -250,7 +250,7 @@ func TestUpdateOrgPermissions(t *testing.T) { } permissionsJSON, _ := json.Marshal(updatedPermissions) - req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organizations/%s/roles/%s/permissions", orgID, roleID), bytes.NewBuffer(permissionsJSON)) + req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organisations/%s/roles/%s/permissions", orgID, roleID), bytes.NewBuffer(permissionsJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -275,7 +275,7 @@ func TestUpdateOrgPermissions(t *testing.T) { } permissionsJSON, _ := json.Marshal(updatedPermissions) - req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organizations/%s/roles/%s/permissions", orgID, roleID), bytes.NewBuffer(permissionsJSON)) + req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organisations/%s/roles/%s/permissions", orgID, roleID), bytes.NewBuffer(permissionsJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer invalid_token") @@ -306,7 +306,7 @@ func TestUpdateOrgPermissions(t *testing.T) { } permissionsJSON, _ := json.Marshal(updatedPermissions) - req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organizations/%s/roles/%s/permissions", orgID, roleID), bytes.NewBuffer(permissionsJSON)) + req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organisations/%s/roles/%s/permissions", orgID, roleID), bytes.NewBuffer(permissionsJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) @@ -333,7 +333,7 @@ func TestUpdateOrgPermissions(t *testing.T) { } permissionsJSON, _ := json.Marshal(invalidPermissions) - req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organizations/%s/roles/%s/permissions", orgID, roleID), bytes.NewBuffer(permissionsJSON)) + req, _ := http.NewRequest(http.MethodPatch, fmt.Sprintf("/api/v1/organisations/%s/roles/%s/permissions", orgID, roleID), bytes.NewBuffer(permissionsJSON)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token))