func (r *GormWorkItemLinkRepository) DeleteRelatedLinks(ctx context.Context, wiIDStr string, suppressorID uuid.UUID) error {
	log.Info(ctx, map[string]interface{}{
		"workitem_id": wiIDStr,
	}, "Deleting the links related to work item")

	wiID, err := strconv.ParseUint(wiIDStr, 10, 64)
	if err != nil {
		// treat as not found: clients don't know it must be a uint64
		return errors.NewNotFoundError("work item link", wiIDStr)
	}
	var workitemLinks = []WorkItemLink{}
	r.db.Where("? in (source_id, target_id)", wiID).Find(&workitemLinks)
	// delete one by one to trigger the creation of a new work item link revision
	for _, workitemLink := range workitemLinks {
		r.deleteLink(ctx, workitemLink, suppressorID)
	}
	return nil
}
// DeleteRelatedLinks deletes all links in which the source or target equals the
// given work item ID.
DeleteRelatedLinks deletes all links in which the source or target equals the
given work item ID.
// DeleteRelatedLinks deletes all links in which the source or target equals the // given work item ID .
func (r *GormWorkItemLinkRepository) DeleteRelatedLinks(ctx context.Context, wiIDStr string, suppressorID uuid.UUID) error {
	log.Info(ctx, map[string]interface{}{
		"workitem_id": wiIDStr,
	}, "Deleting the links related to work item")
	wiID, err := strconv.ParseUint(wiIDStr, 10, 64)
	if err != nil {
		return errors.NewNotFoundError("work item link", wiIDStr)
	}
	var workitemLinks = []WorkItemLink{}
	r.db.Where("? in (source_id, target_id)", wiID).Find(&workitemLinks)
	for _, workitemLink := range workitemLinks {
		r.deleteLink(ctx, workitemLink, suppressorID)
	}
	return nil
}
func ( r * GormWorkItemLinkRepository ) DeleteRelatedLinks ( ctx context . Context , wiIDStr string , suppressorID uuid . UUID ) error { log . Info ( ctx , map [ string ] interface { } { " " : wiIDStr , } , " " ) wiID , err := strconv . ParseUint ( wiIDStr , 10 , 64 ) if err != nil { return errors . NewNotFoundError ( " " , wiIDStr ) } var workitemLinks = [ ] WorkItemLink { } r . db . Where ( " " , wiID ) . Find ( & workitemLinks ) for _ , workitemLink := range workitemLinks { r . deleteLink ( ctx , workitemLink , suppressorID ) } return nil }
DeleteRelatedLinks deletes all links in which the source or target equals the
given work item ID.
DeleteRelatedLinks deletes all links in which the source or target equals the given work item ID .
// treat as not found: clients don't know it must be a uint64 // delete one by one to trigger the creation of a new work item link revision