Skip to content

Commit

Permalink
fix: with context issue in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
elliot14A committed Jan 23, 2024
1 parent c630ff8 commit f9e0e27
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 f9e0e27

Please sign in to comment.