Home
Using Smart NgRX
Demo Walkthrough
API
@smarttools/smart-ngrx / Function

replaceIdInFeatureParents

Used by delete to remove the id from the parent's child field and return the list of parentIds that were affected.

Presentation

function replaceIdInFeatureParents(
  entities: Dictionary<SmartNgRXRowBase>,
  childDefinition: ChildDefinition<SmartNgRXRowBase, SmartNgRXRowBase>,
  parentService: ActionService,
  ids: [string, string | null],
): string[];

Returns

string[] -

the parent ids that are affected by the delete

Parameters

NameTypeDescription
entities
Dictionary<SmartNgRXRowBase>

the entities to look in

childDefinition
ChildDefinition<SmartNgRXRowBase, SmartNgRXRowBase>

the ChildDefinition

parentService
ActionService

the parent service that we will call to report items from parent

ids
[string, string | null]

the oldId and the newId to replace it with