feat: add user_tenant associations
This commit is contained in:
@@ -16,7 +16,7 @@ type user struct{}
|
||||
func (t *user) FindByID(ctx context.Context, userID int64) (*models.User, error) {
|
||||
tbl, query := models.UserQuery.QueryContext(ctx)
|
||||
|
||||
model, err := query.Where(tbl.ID.Eq(userID)).First()
|
||||
model, err := query.Preload(tbl.OwnedTenant, tbl.Tenants).Where(tbl.ID.Eq(userID)).First()
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "FindByID failed, %d", userID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user