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

ref: migrate inline queries for retrieval of submissions metadata to model static methods #601

Merged
merged 10 commits into from
Nov 10, 2020

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Nov 9, 2020

Problem

This PR extracts out the inlined mongoose queries in the /:formId([a-fA-F0-9]{24})/adminform/submissions/metadata controller handler. Also adds celebrate middleware validation for the route.

Solution

Features:

  • Add EncryptSubmissionModel#findSingleMetadata static method to retrieve metadata for a single submission
  • Add EncryptSubmissionModel#findAllMetadatabyFormId static method to retrieve all submission metadatas for the given form id.
  • Add celebrate middleware validation to /:formId([a-fA-F0-9]{24})/adminform/submissions/metadata endpoint.

Improvements:

  • Replace inlined queries in the controller handler for /:formId([a-fA-F0-9]{24})/adminform/submissions/metadata endpoint with EncryptSubmissionModel static methods.

@karrui karrui force-pushed the ref/encrypt-submissions-metadata branch from cc1bf7c to 02398cb Compare November 9, 2020 08:09
@karrui karrui changed the base branch from ref/submission-ctl-service to develop November 9, 2020 08:09
@karrui karrui merged commit f4436e2 into develop Nov 10, 2020
@karrui karrui deleted the ref/encrypt-submissions-metadata branch November 10, 2020 05:34
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