-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix: remove dependencies on use-request.js except from /routes #1607 #2191
Conversation
@@ -181,7 +181,7 @@ function recipientBelongsToUpload(existingRecipient, upload) { | |||
* @param {object} upload - the upload record | |||
* @returns | |||
*/ | |||
async function updateOrCreateRecipient(existingRecipient, newRecipient, trns, upload) { | |||
async function updateOrCreateRecipient(existingRecipient, newRecipient, trns, upload, tenantId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function updateOrCreateRecipient
has 5 arguments (exceeds 4 allowed). Consider refactoring.
@@ -1,12 +1,12 @@ | |||
const { validateUpload } = require('./validate-upload'); | |||
const { uploadsInPeriod } = require('../db/uploads'); | |||
|
|||
async function revalidateUploads(period, user, trns) { | |||
const uploads = await uploadsInPeriod(period.id, trns); | |||
async function revalidateUploads(period, user, req, trns, tenantId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function revalidateUploads
has 5 arguments (exceeds 4 allowed). Consider refactoring.
@@ -139,7 +138,7 @@ async function createObligationSheet(periodId, domain, tenantId, logger = log) { | |||
return rows; | |||
} | |||
|
|||
async function createProjectSummaries(periodId, domain, tenantId, logger = log) { | |||
async function createProjectSummaries(periodId, domain, req, tenantId, logger = log) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function createProjectSummaries
has 5 arguments (exceeds 4 allowed). Consider refactoring.
Code Climate has analyzed commit 91eca3f and detected 3 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 38.8% (50% is the threshold). This pull request will bring the total coverage in the repository to 55.9% (0.0% change). View more on Code Climate. |
Ticket #1607
Description
This issue was recommended by @as1729 as a good "first issue" for ARPA.
This is a refactor to stop using
use-request.js
outside of/routes
, because we don't always want to assume there's a request context. This allows us to use functions without a request context by passing in the arguments they need, e.g.tenantId
Testing
The existing tests were updated to pass in necessary data where they weren't already doing that.
Automated and Unit Tests
Manual tests for Reviewer
Checklist