|
ctx.message.headers.pubSubTenantId = tenantContext?.tenant?.id |
On this line we need to validate that ctx.message.headers exists. Right now we get "Can not set pubSubTenantId of undefined."
suggested fix:
const tenantPublish = async (ctx, next) => {
const tenantContext = tenantContextAccessor.getTenantContext()
ctx.message.headers = ctx.message.headers || {}
ctx.message.headers.pubSubTenantId = tenantContext?.tenant?.id
return await next()
}
generator-graphql-rocket/generators/app/templates/infrastructure/src/pubSub/middleware/tenantPublish.js
Line 5 in 72c1aab
On this line we need to validate that
ctx.message.headersexists. Right now we get "Can not setpubSubTenantIdof undefined."suggested fix: