func (r *GormWorkItemLinkRepository) ListByWorkItemID(ctx context.Context, wiIDStr string) ([]WorkItemLink, error) {
	var modelLinks []WorkItemLink
	wi, err := r.workItemRepo.LoadFromDB(ctx, wiIDStr)
	if err != nil {
		return nil, errs.WithStack(err)
	}
	// Now fetch all links for that work item
	db := r.db.Model(modelLinks).Where("? IN (source_id, target_id)", wi.ID).Find(&modelLinks)
	if db.Error != nil {
		return nil, db.Error
	}
	return modelLinks, nil
}
// ListByWorkItemID returns the work item links that have wiID as source or target.
// TODO: Handle pagination
ListByWorkItemID returns the work item links that have wiID as source or target.
TODO: Handle pagination
// ListByWorkItemID returns the work item links that have wiID as source or target . // TODO : Handle pagination
func (r *GormWorkItemLinkRepository) ListByWorkItemID(ctx context.Context, wiIDStr string) ([]WorkItemLink, error) {
	var modelLinks []WorkItemLink
	wi, err := r.workItemRepo.LoadFromDB(ctx, wiIDStr)
	if err != nil {
		return nil, errs.WithStack(err)
	}
	db := r.db.Model(modelLinks).Where("? IN (source_id, target_id)", wi.ID).Find(&modelLinks)
	if db.Error != nil {
		return nil, db.Error
	}
	return modelLinks, nil
}
func ( r * GormWorkItemLinkRepository ) ListByWorkItemID ( ctx context . Context , wiIDStr string ) ( [ ] WorkItemLink , error ) { var modelLinks [ ] WorkItemLink wi , err := r . workItemRepo . LoadFromDB ( ctx , wiIDStr ) if err != nil { return nil , errs . WithStack ( err ) } db := r . db . Model ( modelLinks ) . Where ( " " , wi . ID ) . Find ( & modelLinks ) if db . Error != nil { return nil , db . Error } return modelLinks , nil }
ListByWorkItemID returns the work item links that have wiID as source or target.
ListByWorkItemID returns the work item links that have wiID as source or target .
// Now fetch all links for that work item