Skip to content

Conversation

@stoopidJSON
Copy link
Member

@stoopidJSON stoopidJSON commented Jun 4, 2020

This provides a variety of bug fixes as defined by the resolved tickets.
Primarily this PR will add contact-direct check-in capabilities. This allows
Authorized contacts to check-in entities directly without a user account by using an
auth token.
resolves #131
resolves #132
resolves #102
resolves #162
resolves #173
resolves #145
resolves #158
resolves #180

Todos

  • Tests
  • Documentation

Deploy Notes

There is a new endpoint defined in Swagger that will allow for emails to be sent to contacts. Sending that email blast is touchy. To test you must set an .env var for: -

  • URL=http://localhost:8080 an
  • TEST_EMAIL=yourmail@codeforbaltimore.org

Then you must make sure at least one contact email in the system is equal to your test email set above.

This provides a variety of bug fixes as defined by the resolved tickets.
Primarily this PR will add contact-direct check-in capabilities. This allows
Authorized contacts to check-in entities direclty without a user account by using an
auth token.
resolves #131
resolves #132
resolves #102
resolves #162
resolves #173
resolves #145
resolves #158
resolves #180
@stoopidJSON stoopidJSON requested review from a team, c-w-allen and msmith125 June 4, 2020 18:06
@stoopidJSON stoopidJSON marked this pull request as draft June 4, 2020 18:11
@stoopidJSON stoopidJSON marked this pull request as ready for review June 4, 2020 20:03

EntityContact.findByEntityId = async (entityId) => {
const entries = await EntityContact.findAll({
where: {entityId}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this automatically find it by pk?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not for some reason. Not sure what was off about that but it wasn't really worth debugging. When I used findByPk nothing came back.

/** @todo allow for passing entity and contact arrays */
const { entityIds, contactIds, relationshipTitle } = req.body;

if (entityIds === undefined && contactIds === undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is only running if entityIds and contactIds is undefined. If that's the case. are they needed in the request body?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's for future planning. Eventually, we're going to allow for passing an array of either or both types of ID's to only send emails to those associations. For now, though, that functionality isn't in there.

let message;
try {
if (validator.isEmail(req.body.email)) {
console.log(req.body.password)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this safe to keep?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no that probably needs to go 😎

@stoopidJSON stoopidJSON merged commit 2320e1a into master Jun 5, 2020
@stoopidJSON
Copy link
Member Author

@allcontributors add @c-w-allen for review

@allcontributors
Copy link
Contributor

@revjtanton

I've put up a pull request to add @c-w-allen! 🎉

@stoopidJSON
Copy link
Member Author

@allcontributors add @msmith125 for review

@allcontributors
Copy link
Contributor

@revjtanton

I've put up a pull request to add @msmith125! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment