Add 'questOwner' to the return data of a 'questActivity' webhook. (#13277)

* Update webhook.js

Add `questOwner: group.quest.leader,` to webhook.js

* Update POST-groups_groupId_quests_invite.test.js

Test if questOwner contains the correct data

* Update POST-groups_groupId_quests_invite.test.js

* Update webhooks.test.js
This commit is contained in:
PitiTheGrey 2021-05-28 23:59:14 +02:00 committed by GitHub
parent 9e655d70d2
commit 1037510c9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View file

@ -656,9 +656,11 @@ describe('webhooks', () => {
id: 'group-id',
name: 'some group',
otherData: 'foo',
quest: {},
},
quest: {
key: 'some-key',
questOwner: 'user-id',
},
};
});

View file

@ -263,6 +263,7 @@ describe('POST /groups/:groupId/quests/invite/:questKey', () => {
expect(body.group.id).to.eql(questingGroup.id);
expect(body.group.name).to.eql(questingGroup.name);
expect(body.quest.key).to.eql(PET_QUEST);
expect(body.quest.questOwner).to.eql(questingGroup.leader._id);
});
});
});

View file

@ -183,6 +183,7 @@ export const questActivityWebhook = new WebhookSender({
},
quest: {
key: quest.key,
questOwner: group.quest.leader,
},
};