Correction récupération/fusion des Workgroups
This commit is contained in:
@ -48,7 +48,7 @@ func (r *WorkgroupRepository) CreateWorkgroup(ctx context.Context, changes Workg
|
||||
Name: changes.Name,
|
||||
}
|
||||
|
||||
if err := r.db.Model(&Workgroup{}).Create(workgroup).Error; err != nil {
|
||||
if err := r.db.Model(&Workgroup{}).Preload("Members").Create(workgroup).Error; err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ func (r *WorkgroupRepository) RemoveUserFromWorkgroup(ctx context.Context, userI
|
||||
|
||||
func (r *WorkgroupRepository) Find(ctx context.Context, id string) (*Workgroup, error) {
|
||||
wg := &Workgroup{}
|
||||
query := r.db.Model(wg).Where("id = ?", id)
|
||||
query := r.db.Model(wg).Preload("Members").Where("id = ?", id)
|
||||
|
||||
if err := query.First(&wg).Error; err != nil {
|
||||
return nil, errs.WithStack(err)
|
||||
|
Reference in New Issue
Block a user