Routes: CardDetail
File Name: carddetail.js
File Path: server/routes/api/carddetail.js
Contains route which can cerate, update, view and delete the user details. These functionalities are included in CardDetail Controller.
Post CardDetails Route
1.API Path:
api/carddetails
2.Method:
POST
3.Description:
CardDetail route is used to create a new users carddetail. CardDetail can be either a Rider or a Driver. This route also checks if user has already have carddetail an or not.
4.Parameters:
Name: req
Type: Object
| FieldName | Type | Required | | :--- | :--- | :--- | | user | ObjectId | true | | lastFourDigit | Number | true | | customerId | String | true |
Response:
Http Code: 200
Data: { }
Type: Object
Name | Type |
---|---|
statusCode | status |
Data | object |
Description: Data is an Object with an cardDetail.
Get CardDetails Route
1.API Path:
api/carddetails
2.Method:
GET
3.Description:
CardDetail route is used to get all carddetails. CardDetail can be either a Rider or a Driver.
4.Parameters:
Name: req
Type: Object
5.Response:
- Http code: 200
- Data: [ ]
- Type: Array
Name | Type |
---|---|
statusCode | status |
Data | Array |
Description:Data is an Array with an cardDetail list.
Get CardDetails Route
1.API Path:
api/carddetails
2.Method:
GET
3.Description:
CardDetail route is used to get all carddetails. CardDetail can be either a Rider or a Driver.
4.Parameters:
Name: req
Type: Object
5.Response:
- Http code: 200
- Data: [ ]
- Type: Array
Name | Type |
---|---|
statusCode | status |
Data | Array |
Description:Data is an Array with an cardDetail list.
Get CardDetails(particular carddetail) Route
1.API Path:
api/carddetails/:id
2.Method:
GET
3.Description:
CardDetail route is used to get all carddetails. CardDetail can be either a Rider or a Driver.
4.Parameters:
Name: req,
Type: Object,
id: req.params.id
5.Response:
- Http code: 200
- Data: { }
- Type: Object
Name | Type |
---|---|
statusCode | status |
Data | Object |
Description:Data is an Object with an particular cardDetail.
Update CardDetails(particular carddetail) Route
1.API Path:
api/carddetails/:id
2.Method:
PUT
3.Description:
CardDetail route is used to update all carddetails. CardDetail can be either a Rider or a Driver.
4.Parameters:
Name: req,
Type: Object,
id: req.params.id
5.Response:
- Http code:200
- Data:{ }
- Type: Object
Name | Type |
---|---|
statusCode | status |
Data | object |
Description:Data is an Object with a particular cardDetail.
Delete CardDetails(particular carddetail) Route
1.API Path:
api/carddetails/:id
2.Method:
DELETE
3.Description:
CardDetail route is used to update all carddetails. CardDetail can be either a Rider or a Driver.
4.Parameters:
Name: req,
Type: Object,
id: req.params.id
5.Response:
- Http code: 200
- Data: { }
- Type: Object
Name | Type |
---|---|
statusCode | status |
Data | blank Object |
Description:Data is an Object with a particular cardDetail.