fixed git clone link
This commit is contained in:
@@ -15,7 +15,8 @@ Clone this repo as shown below, if you have [git](https://git-scm.com/downloads)
|
||||
otherwise [download as zip file](archive/master.zip).
|
||||
|
||||
```sh
|
||||
git clone https://github.com/sap-samples/cloud-cap-samples samples
|
||||
# git clone https://github.com/sap-samples/cloud-cap-samples samples
|
||||
git clone https://github.com/SAP-samples/cloud-cap-samples -b cap-samples-reloaded samples
|
||||
cd samples
|
||||
```
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ GET http://localhost:4004/reviews/Reviews?
|
||||
POST http://localhost:4004/reviews/Reviews
|
||||
Content-Type: application/json;IEEE754Compatible=true
|
||||
|
||||
{"subject":"201", "rating":"5", "title":"boo"}
|
||||
{"subject":"201", "title":"boo"}
|
||||
|
||||
|
||||
|
||||
@@ -37,4 +37,4 @@ GET http://localhost:5005/reviews/Reviews?
|
||||
POST http://localhost:5005/reviews/Reviews
|
||||
Content-Type: application/json;IEEE754Compatible=true
|
||||
|
||||
{"subject":"201", "rating":"5", "title":"boo"}
|
||||
{"subject":"201", "title":"boo"}
|
||||
|
||||
@@ -5,6 +5,10 @@ module.exports = cds.service.impl (function(){
|
||||
// ( Note: we explicitly specify the namespace to support embedded reuse )
|
||||
const { Reviews, Likes } = this.entities ('sap.capire.reviews')
|
||||
|
||||
this.before (['CREATE','UPDATE','DELETE'], 'Reviews', req => {
|
||||
if (!req.data.rating) req.data.rating = Math.round(Math.random()*4)+1
|
||||
})
|
||||
|
||||
// Emit an event to inform subscribers about new avg ratings for reviewed subjects
|
||||
// ( Note: req.on.succeeded ensures we only do that if there's no error )
|
||||
this.after (['CREATE','UPDATE','DELETE'], 'Reviews', async(_,req) => {
|
||||
|
||||
@@ -10,7 +10,7 @@ POST http://localhost:5005/reviews/Reviews
|
||||
# POST http://localhost:4004/reviews/Reviews
|
||||
Content-Type: application/json;IEEE754Compatible=true
|
||||
|
||||
{"subject":"201", "rating":"5", "title":"boo"}
|
||||
{"subject":"201", "rating":"4", "title":"boo"}
|
||||
|
||||
### Direct Request to ReviewsService
|
||||
# Note: use 5005 instead of 4004 in case of separate service
|
||||
|
||||
Reference in New Issue
Block a user