Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
danicc097 committed Jun 7, 2024
1 parent ad7ceb6 commit 1412517
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/services/service_work_item_project_demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func NewDemoWorkItem(logger *zap.SugaredLogger, repos *repos.Repos) *DemoWorkIte
func (w *DemoWorkItem) ByID(ctx context.Context, d models.DBTX, id models.WorkItemID) (*models.WorkItem, error) {
defer newOTelSpan().Build(ctx).End()

wi, err := w.repos.DemoWorkItem.ByID(ctx, d, id)
opts := append(w.wiSvc.getSharedDBOpts(), models.WithWorkItemJoin(models.WorkItemJoins{DemoWorkItem: true}))
wi, err := w.repos.DemoWorkItem.ByID(ctx, d, id, opts...)
if err != nil {
return nil, fmt.Errorf("repos.DemoWorkItem.ByID: %w", err)
}
Expand Down Expand Up @@ -77,10 +78,9 @@ func (w *DemoWorkItem) Create(ctx context.Context, d models.DBTX, caller CtxUser
return nil, err
}

opts := append(w.wiSvc.getSharedDBOpts(), models.WithWorkItemJoin(models.WorkItemJoins{DemoWorkItem: true}))
wi, err := w.repos.DemoWorkItem.ByID(ctx, d, demoWi.WorkItemID, opts...)
wi, err := w.ByID(ctx, d, demoWi.WorkItemID)
if err != nil {
return nil, fmt.Errorf("repos.DemoWorkItem.ByID: %w", err)
return nil, fmt.Errorf("ByID: %w", err)
}

return wi, nil
Expand Down

0 comments on commit 1412517

Please sign in to comment.