Skip to content

Commit

Permalink
2.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
royalfig committed Jan 4, 2023
1 parent d0e9e59 commit 5164232
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.6.2

* Add `status` property to Member Updated trigger
* Fix Member Search action to return correct results when no member is found

## 2.6.0

* (New) Allow multiple newsletters to be added to members
Expand Down
5 changes: 5 additions & 0 deletions app/searches/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ const searchMembers = async (z, bundle) => {
try {
const member = await api.members.browse(queryParams);

// There's a conflict between Zapier's test conditions, nock responses, and not wanting to double wrap arrays. This was the best solution to satisfy these conditions atm.
if (Array.isArray(member)) {
return member;
}

return [member];
} catch (err) {
if (err.name === 'HaltedError' && err.message.match(/404/)) {
Expand Down
2 changes: 2 additions & 0 deletions app/triggers/member_updated.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const SAMPLE_PAYLOAD = {
email: 'sample@example.com',
note: 'Updated sample member record.',
subscribed: false,
status: 'paid',
comped: true,
labels: [{
id: '5f212d395422021ebc4b7043',
Expand All @@ -35,6 +36,7 @@ const SAMPLE_PAYLOAD = {
email: 'oldsample@example.com',
note: 'Old sample member record.',
subscribed: true,
status: 'free',
comped: false,
labels: [{
id: '5f212d395422021ebc4b7043',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ghost-zapier",
"version": "2.6.0",
"version": "2.6.2",
"description": "Ghost integration for the Zapier platform.",
"repository": "TryGhost/Zapier",
"homepage": "https://ghost.org/",
Expand Down
4 changes: 2 additions & 2 deletions test/triggers/member_updated.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ describe('Triggers', function () {
return appTester(App.triggers.member_updated.operation.performList, {authData})
.then(([member]) => {
should.exist(member.current);
Object.keys(member.current).length.should.eql(9);
Object.keys(member.current).length.should.eql(10);
should.exist(member.previous);
Object.keys(member.previous).length.should.eql(7);
Object.keys(member.previous).length.should.eql(8);

member.current.id.should.eql('5a01d3ecc8d50d0e606a7e7c');

Expand Down

0 comments on commit 5164232

Please sign in to comment.