Skip to content

Commit 64b3072

Browse files
authored
Accept email when it already exists (#151)
* Accept email when it already exists * Accept email when it already exists
1 parent c89350d commit 64b3072

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ __pycache__/
1717
.idea/**/usage.statistics.xml
1818
.idea/**/dictionaries
1919
.idea/**/shelf
20+
.idea/copilot/
2021

2122
# AWS User-specific
2223
.idea/**/aws.xml

backend/api/add-member.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ export default async function handler(req, res) {
5454
return res.status(200).json(response.data);
5555
} catch (error) {
5656
console.error("Ghost error", error.response.data.errors);
57+
if (error.response.data.errors[0].context === 'Member already exists. Attempting to add member with existing email address') {
58+
return res.status(200).json({});
59+
}
5760
return res.status(500).json({ error: `${error.response.data.errors[0].message} Context: ${error.response.data.errors[0].context}` });
5861
}
5962
}

0 commit comments

Comments
 (0)