Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/e2b-dev/infra
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentaTomas committed Oct 16, 2023
2 parents b9cdf4e + a019b80 commit c84dfbc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/api/internal/db/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package db

import (
"fmt"

"github.com/volatiletech/null/v8"

"github.com/e2b-dev/infra/packages/api/internal/db/models"
Expand All @@ -12,9 +11,7 @@ import (
func (db *DB) GetDefaultTeamFromUserID(userID string) (result *models.Team, err error) {
userWhere := models.UsersTeamWhere.UserID.EQ(userID)
defaultTeamWhere := models.TeamWhere.IsDefault.EQ(null.BoolFrom(true))
joinTeam := qm.InnerJoin(models.TableNames.Teams + " on " + models.TableNames.UsersTeams + "." + models.UsersTeamColumns.TeamID + " = " + models.TableNames.Teams + "." + models.TeamColumns.ID)

userTeam, err := models.UsersTeams(qm.Load(models.UsersTeamRels.Team), joinTeam, userWhere, defaultTeamWhere).One(db.Client)
userTeam, err := models.UsersTeams(qm.Load(models.UsersTeamRels.Team, defaultTeamWhere), userWhere).One(db.Client)
if err != nil {
errMsg := fmt.Errorf("failed to list envs: %w", err)
fmt.Println(errMsg.Error())
Expand Down

0 comments on commit c84dfbc

Please sign in to comment.