-
Notifications
You must be signed in to change notification settings - Fork 2
Activities
RESTful protocol for Activities.
The following Foreign Key apply:
activities.pers_id : Foreign Key to Persons
GET /api/act?pers_id={pers_id} | index
Fetches the Activities of a Perosn using the query parameter pers_id
.
Consumes: Route, Parameter
Produces: JSON
GET /api/act/{act-id} | show
Fetches the properties of the Activity and other included entities (names, ids) such as ActivityModels.
Consumes: Route
Produces: JSON
{ "success": true, "message": "Activities retrieved successfully", "size": 2, "data": [ { "_id": { "$oid": "4ff5bca7e4b0082c63d08dfb" }, "name": "Cooking2", "type": "Coocking", "description": "Bla bla2", "pers_id": "4ff5bca7e4b0082c63d08dfa" }, { "_id": { "$oid": "4ff5bca7e4b0082c63d08dfc" }, "name": "Ironing", "description": "Bla bla Ironing", "pers_id": "4ff5bca7e4b0082c63d08dfa" } ] }
POST /api/act | create
Creates a new Activity based on the things added in the form.
Consumes: Route, JSON
{ name: "Cooking2", type : "Coocking", description: "Bla bla2", pers_id: "4ff410c8e4b0c338f131dea3" }
Produces: JSON
PUT /api/act/{act-id} | update
Updates the properties of the Activity after editing.
Consumes: Route, JSON
{ name: "Cooking2", type : "Coocking", description: "Bla bla2", pers_id: "4ff410c8e4b0c338f131dea3" }
Produces: JSON with update status
DELETE /api/act/{act-id} | delete
Deletes the existing Activity.
Consumes: Route
Produces: Delete status