Skip to content

Commit

Permalink
Merge pull request #417 from factly/fix-with-context-issue-in-prd
Browse files Browse the repository at this point in the history
fix: with context issue in prod
  • Loading branch information
vsumit89 authored Jan 30, 2024
2 parents c01ea1d + f9e0e27 commit 3a7bfa3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/action/organisation/application/addDefault.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package application

import (
"context"
"errors"
"fmt"
"net/http"
Expand Down Expand Up @@ -65,7 +66,8 @@ func addDefault(w http.ResponseWriter, r *http.Request) {
return
}

tx := model.DB.Begin()
var userContext model.ContextKey = "application_user"
tx := model.DB.WithContext(context.WithValue(r.Context(), userContext, uID)).Begin()
app := model.Application{}
err = tx.Model(&model.Application{}).Where(&model.Application{
Base: model.Base{
Expand Down

0 comments on commit 3a7bfa3

Please sign in to comment.