diff --git a/src/forms-pipe.js b/src/forms-pipe.js index 66703e5c..7867c5ef 100644 --- a/src/forms-pipe.js +++ b/src/forms-pipe.js @@ -140,10 +140,12 @@ export async function formsPipe(state, request) { // sheet and the source location is not null const host = getOriginalHost(request.headers); + // Forms service expect owner and repo in the message body + body.owner = owner; + body.repo = repo; + const message = { url: `https://${ref}--${repo}--${owner}.hlx.live${resourcePath}`, - owner, - repo, body, host, sourceLocation, diff --git a/test/forms-pipe.test.js b/test/forms-pipe.test.js index efb633d7..adeea1f9 100644 --- a/test/forms-pipe.test.js +++ b/test/forms-pipe.test.js @@ -25,8 +25,8 @@ class MockDispatcher { // eslint-disable-next-line class-methods-use-this async dispatch(message) { assert.strictEqual(message.sourceLocation, 'foo-bar'); - assert.strictEqual(message.owner, 'owner'); - assert.strictEqual(message.repo, 'repo'); + assert.strictEqual(message.body.owner, 'owner'); + assert.strictEqual(message.body.repo, 'repo'); return { requestId: 'fake-requestId', messageId: 'fake-message-id',