Skip to content

Commit

Permalink
Merge pull request #415 from factly/fix/go-lint
Browse files Browse the repository at this point in the history
Update docker-compose.yml and server files
  • Loading branch information
shreeharsha-factly authored Jan 10, 2024
2 parents cf18cc1 + 2476c40 commit c630ff8
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ services:
- REACT_APP_PUBLIC_PATH_DEVELOPMENT=/.factly/kavach/web/
- REACT_APP_KAVACH_TITLE=Kavach
- REACT_APP_COMPANION_URL=http://127.0.0.1:3020

- REACT_APP_API_URL=http://127.0.0.1:4455/.factly/kavach/server
- REACT_APP_KRATOS_PUBLIC_URL=http://127.0.0.1:4455/.ory/kratos/public
- REACT_APP_ENABLE_MULTITENANCY=true
Expand All @@ -250,7 +251,10 @@ services:
- type: bind
source: ./web
target: /app
- /app/node_modules
- type: bind
source: ./web/node_modules
target: /app/node_modules
# - /app/node_modules
restart: unless-stopped
networks:
- kavach
Expand Down
6 changes: 4 additions & 2 deletions server/action/admin/organisation/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ func create(w http.ResponseWriter, r *http.Request) {
return
}

result := model.Organisation{}
var result model.Organisation

result = *organisation
if organisation != nil {
result = *organisation
}

result.OrganisationUsers = []model.OrganisationUser{permission}

Expand Down
7 changes: 5 additions & 2 deletions server/action/admin/organisation/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ func update(w http.ResponseWriter, r *http.Request) {
errorx.Render(w, errorx.Parser(errorx.RecordNotFound()))
return
}
result := model.Organisation{}
result = *organisation
var result model.Organisation
if organisation != nil {
result = *organisation
}

result.OrganisationUsers = []model.OrganisationUser{*permission}

tx.Commit()
Expand Down
4 changes: 2 additions & 2 deletions server/action/organisation/application/addDefault.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ func addDefault(w http.ResponseWriter, r *http.Request) {
errorx.Render(w, errorx.Parser(errorx.DBError()))
return
}
newOrganisations := make([]model.Organisation, 0)
newOrganisations = append(app.Organisations, *org)

newOrganisations := append(app.Organisations, *org)
err = tx.Model(&app).Association("Organisations").Replace(&newOrganisations)
if err != nil {
tx.Rollback()
Expand Down
3 changes: 1 addition & 2 deletions server/action/organisation/application/roles/user/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ func create(w http.ResponseWriter, r *http.Request) {
return
}

users := make([]model.User, 0)
users = append(appRole.Users, user)
users := append(appRole.Users, user)
appRole.Users = users
if err = model.DB.Model(&appRole).Association("Users").Replace(&users); err != nil {
tx.Rollback()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ func create(w http.ResponseWriter, r *http.Request) {
errorx.Render(w, errorx.Parser(errorx.DBError()))
return
}
users := make([]model.User, 0)
users = append(spaceRole.Users, user)

users := append(spaceRole.Users, user)
spaceRole.Users = users
if err = tx.Model(&spaceRole).Association("Users").Replace(&users); err != nil {
tx.Rollback()
Expand Down
3 changes: 2 additions & 1 deletion server/action/organisation/user/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func list(w http.ResponseWriter, r *http.Request) {
errorx.Render(w, errorx.Parser(errorx.RecordNotFound()))
return
}
userIDs := []string{}

var userIDs []string

if role == "owner" || role == "member" {
userIDs, err = keto.ListSubjectsByObjectID(namespace, role, fmt.Sprintf("org:%d", orgID))
Expand Down
5 changes: 0 additions & 5 deletions server/action/user/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ type matchContext struct {
URL *url.URL `json:"url"`
}

type templateContent struct {
From map[string]interface{} `json:"from"`
Personalizations []interface{} `json:"personalizations"`
TemplateID string `json:"template_id"`
}

// create organisation
func checker(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit c630ff8

Please sign in to comment.