Skip to content

Commit

Permalink
fix: forms service expect repo and owner in message body
Browse files Browse the repository at this point in the history
  • Loading branch information
dylandepass committed May 18, 2022
1 parent 01f7139 commit a14e6a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/forms-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions test/forms-pipe.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a14e6a0

Please sign in to comment.