Skip to content

Commit

Permalink
Accept email when it already exists (#151)
Browse files Browse the repository at this point in the history
* Accept email when it already exists

* Accept email when it already exists
Janaka-Steph authored Apr 2, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent c89350d commit 64b3072
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ __pycache__/
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
.idea/copilot/

# AWS User-specific
.idea/**/aws.xml
3 changes: 3 additions & 0 deletions backend/api/add-member.js
Original file line number Diff line number Diff line change
@@ -54,6 +54,9 @@ export default async function handler(req, res) {
return res.status(200).json(response.data);
} catch (error) {
console.error("Ghost error", error.response.data.errors);
if (error.response.data.errors[0].context === 'Member already exists. Attempting to add member with existing email address') {
return res.status(200).json({});
}
return res.status(500).json({ error: `${error.response.data.errors[0].message} Context: ${error.response.data.errors[0].context}` });
}
}

0 comments on commit 64b3072

Please sign in to comment.