review/reviewed -> reviewed
This commit is contained in:
@@ -20,7 +20,7 @@ cds.once('served', async ({CatalogService}) => {
|
||||
return SELECT(columns).from(Reviews).limit(limit).where({subject:String(id)})
|
||||
}))
|
||||
|
||||
messaging.on ('review/reviewed', (msg) => {
|
||||
messaging.on ('reviewed', (msg) => {
|
||||
console.debug ('> received:', msg.event, msg.data)
|
||||
const { subject, rating } = msg.data
|
||||
return UPDATE(Books,subject).with({rating})
|
||||
|
||||
@@ -18,7 +18,7 @@ module.exports = cds.service.impl (async function(){
|
||||
)
|
||||
const msgTx = messaging.tx(req)
|
||||
global.it || console.log ('< emitting:', 'reviewed', { subject, rating })
|
||||
msgTx.emit ('review/reviewed', { subject, rating })
|
||||
msgTx.emit ('reviewed', { subject, rating })
|
||||
})
|
||||
|
||||
// Increment counter for reviews considered helpful
|
||||
|
||||
@@ -24,11 +24,11 @@ describe('Messaging', ()=>{
|
||||
|
||||
let N=0, received=[], M=0
|
||||
it ('should add messaging event handlers', ()=>{
|
||||
messaging.on('review/reviewed', (msg,next)=> { received.push(msg); return next() })
|
||||
messaging.on('reviewed', (msg,next)=> { received.push(msg); return next() })
|
||||
})
|
||||
|
||||
it ('should add more messaging event handlers', ()=>{
|
||||
messaging.on('review/reviewed', (_,next)=> { ++M; return next() })
|
||||
messaging.on('reviewed', (_,next)=> { ++M; return next() })
|
||||
})
|
||||
|
||||
it ('should add review', async ()=>{
|
||||
|
||||
Reference in New Issue
Block a user