Skip to content

Commit ac1b9dc

Browse files
committed
fix(entity-contact): Allowing contacts w/out emails
If the contact has no email it can still be associated to the entity. Resolves #363
1 parent 1bc5e71 commit ac1b9dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/models/entity-contact.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const entityContact = (sequelize, DataTypes) => {
5252
// Grant perms on checkins
5353
const contact = await models.Contact.findById(ec.contactId)
5454

55-
if (typeof contact.email !== 'undefined' && contact.email.length > 0) {
55+
if (contact.email !== undefined) {
5656
const e = await utils.loadCasbin()
5757
for (const email of contact.email) {
5858
const p = [email.address, `/entity/${ec.entityId}`, '(GET)|(POST)']

0 commit comments

Comments
 (0)