mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
visgraph: adding endpoint to get list of relations
This commit is contained in:
parent
d06a4b1ca9
commit
bd2ee9ddc1
@ -900,7 +900,28 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
]
|
],
|
||||||
|
[
|
||||||
|
'class' => \Chill\PersonBundle\Entity\Relationships\Relation::class,
|
||||||
|
'controller' => \Chill\PersonBundle\Controller\RelationshipApiController::class,
|
||||||
|
'name' => 'relations',
|
||||||
|
'base_path' => '/api/1.0/relations/relation',
|
||||||
|
'base_role' => 'ROLE_USER',
|
||||||
|
'actions' => [
|
||||||
|
'_index' => [
|
||||||
|
'methods' => [
|
||||||
|
Request::METHOD_GET => true,
|
||||||
|
Request::METHOD_HEAD => true
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'_entity' => [
|
||||||
|
'methods' => [
|
||||||
|
Request::METHOD_GET => true,
|
||||||
|
Request::METHOD_HEAD => true
|
||||||
|
]
|
||||||
|
],
|
||||||
|
]
|
||||||
|
],
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ class Relation
|
|||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\GeneratedValue
|
* @ORM\GeneratedValue
|
||||||
* @ORM\Column(type="integer")
|
* @ORM\Column(type="integer")
|
||||||
|
* @Serializer\Groups({"read"})
|
||||||
*/
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
|
@ -110,6 +110,14 @@ const getRelationshipsByPerson = (person) => {
|
|||||||
`/api/1.0/relations/relationship/by-person/${person._id}.json`)
|
`/api/1.0/relations/relationship/by-person/${person._id}.json`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return list of relations
|
||||||
|
* @returns {Promise<Response>}
|
||||||
|
*/
|
||||||
|
const getRelationsList = () => {
|
||||||
|
return getFetch(`/api/1.0/relations/relation.json`)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function postRelationship
|
* @function postRelationship
|
||||||
* @param person
|
* @param person
|
||||||
@ -132,5 +140,6 @@ export {
|
|||||||
getHouseholdByPerson,
|
getHouseholdByPerson,
|
||||||
getCoursesByPerson,
|
getCoursesByPerson,
|
||||||
getRelationshipsByPerson,
|
getRelationshipsByPerson,
|
||||||
postRelationship
|
getRelationsList,
|
||||||
|
postRelationship,
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ components:
|
|||||||
- $ref: "#/components/schemas/RelationById"
|
- $ref: "#/components/schemas/RelationById"
|
||||||
reverse:
|
reverse:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
/1.0/person/person/{id}.json:
|
/1.0/person/person/{id}.json:
|
||||||
@ -1093,7 +1093,7 @@ paths:
|
|||||||
description: "OK"
|
description: "OK"
|
||||||
400:
|
400:
|
||||||
description: "transition cannot be applyed"
|
description: "transition cannot be applyed"
|
||||||
|
|
||||||
/1.0/person/accompanying-course/by-person/{person_id}.json:
|
/1.0/person/accompanying-course/by-person/{person_id}.json:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -1647,7 +1647,7 @@ paths:
|
|||||||
description: "OK"
|
description: "OK"
|
||||||
400:
|
400:
|
||||||
description: "Bad Request"
|
description: "Bad Request"
|
||||||
|
|
||||||
/1.0/relations/relationship.json:
|
/1.0/relations/relationship.json:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
@ -1671,3 +1671,14 @@ paths:
|
|||||||
description: "Unauthorized"
|
description: "Unauthorized"
|
||||||
422:
|
422:
|
||||||
description: "Invalid data: the data is a valid json, could be deserialized, but does not pass validation"
|
description: "Invalid data: the data is a valid json, could be deserialized, but does not pass validation"
|
||||||
|
|
||||||
|
/1.0/relations/relation.json:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- relationships
|
||||||
|
summary: get a list of relations
|
||||||
|
responses:
|
||||||
|
401:
|
||||||
|
description: "Unauthorized"
|
||||||
|
200:
|
||||||
|
description: "OK"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user