Skip to content

Commit

Permalink
fix(entity-contact): Allowing contacts w/out emails
Browse files Browse the repository at this point in the history
If the contact has no email it can still be associated to the entity.
Resolves #363
  • Loading branch information
stoopidJSON committed Mar 25, 2021
1 parent 1bc5e71 commit ac1b9dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/entity-contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const entityContact = (sequelize, DataTypes) => {
// Grant perms on checkins
const contact = await models.Contact.findById(ec.contactId)

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

0 comments on commit ac1b9dc

Please sign in to comment.