mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
visgraph: prepare PATCH relationship when submitting (wip)
This commit is contained in:
@@ -139,10 +139,35 @@ const postRelationship = (fromPerson, toPerson, relation, reverse) => {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @function patchRelationship
|
||||
* @param relationship
|
||||
* @returns {Promise<Response>}
|
||||
*/
|
||||
const patchRelationship = (relationship) => {
|
||||
return patchFetch(
|
||||
`/api/1.0/relations/relationship/${relationship._id}.json`,
|
||||
{
|
||||
type: 'relationship',
|
||||
fromPerson: { type: 'person',
|
||||
id: fromPerson._id
|
||||
},
|
||||
toPerson: { type: 'person',
|
||||
id: toPerson._id
|
||||
},
|
||||
relation: { type: 'relation',
|
||||
id: relation.id
|
||||
},
|
||||
reverse: reverse
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export {
|
||||
getHouseholdByPerson,
|
||||
getCoursesByPerson,
|
||||
getRelationshipsByPerson,
|
||||
getRelationsList,
|
||||
postRelationship,
|
||||
patchRelationship
|
||||
}
|
||||
|
Reference in New Issue
Block a user