updateRelation method
Future<WriteResult>
updateRelation(
- String resourceKey,
- Object id,
- RelationDescriptor relation,
- Object childId,
- Map<
String, dynamic> values,
override
PUT /{resource}/{id}/relations/{relation}/{childId} — updates one child
row, resolved through the relationship (P9): childId is the related
model's own key (the relation's published recordKey), and a child that
is not this parent's answers 404, never a cross-parent write.
Implementation
@override
Future<WriteResult> updateRelation(
String resourceKey,
Object id,
RelationDescriptor relation,
Object childId,
Map<String, dynamic> values,
) async {
try {
return _interpret(
await _transport.put(
'$prefix/$resourceKey/$id/relations/${relation.key}/$childId',
values,
),
);
} catch (e) {
return WriteFailed(messageOf(e));
}
}