fixed git clone link
This commit is contained in:
@@ -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