Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: typify webhook and migrate from middleware pattern #251

Merged
merged 17 commits into from
Sep 2, 2020

Conversation

arshadali172
Copy link
Contributor

@arshadali172 arshadali172 commented Sep 1, 2020

Problem

Partially addresses #144

Solution

  • Migrate controller away from middleware pattern
  • Remove controller tests; tests are now only for service and util
  • Note that service now only expose pushData and tests are refactored accordingly

@arshadali172 arshadali172 changed the title Webhook migration refactor: typify webhook and migrate from middleware pattern Sep 1, 2020
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

some comments! how's writing tests in jest instead of jasmine

src/app/models/form.server.model.ts Show resolved Hide resolved
src/app/modules/webhook/webhook.controller.ts Outdated Show resolved Hide resolved
src/app/modules/webhook/webhook.controller.ts Show resolved Hide resolved
src/app/modules/webhook/webhook.controller.ts Show resolved Hide resolved
src/app/modules/webhook/webhook.service.ts Outdated Show resolved Hide resolved
src/app/modules/webhook/webhook.service.ts Outdated Show resolved Hide resolved
src/app/modules/webhook/webhook.service.ts Outdated Show resolved Hide resolved
tests/unit/backend/modules/webhook/webhook.service.spec.ts Outdated Show resolved Hide resolved
src/app/modules/webhook/webhook.controller.ts Outdated Show resolved Hide resolved
src/app/modules/webhook/webhook.service.ts Show resolved Hide resolved
Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm! Please tag the TODO before merging :D

src/app/modules/webhook/webhook.controller.ts Show resolved Hide resolved
@arshadali172 arshadali172 merged commit c304e26 into develop Sep 2, 2020
res: Response,
next: NextFunction,
) => {
// TODO: Once we move away from the middleware pattern, there should not be a webhook controller
Copy link
Contributor

Choose a reason for hiding this comment

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

I meant as in TODO(#149): .... but ok la can see reference in github haha

@karrui karrui deleted the webhook-migration branch September 2, 2020 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants