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

fix: adds earmark as valid option #1980

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/server/__tests__/db/db.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ describe('db', () => {
costSharing: 'not a yes or no',
agencyCode: 99,
bill: 99,
opportunityCategories: ['Earmark', 'foo'],
};
const errors = db.validateSearchFilters(badFilters);
expect(errors.length).to.equal(4);
expect(errors.length).to.equal(5);
expect(errors[0]).to.equal('Received invalid filter opportunityNumber, expected String, received 99');
expect(errors[1]).to.equal('Received invalid filter costSharing, expected Enum, found value not a yes or no that is not in Yes,No');
expect(errors[2]).to.equal('Received invalid filter agencyCode, expected String, received 99');
expect(errors[3]).to.equal('Received invalid filter bill, expected String, received 99');
expect(errors[4]).to.equal('Received invalid filter opportunityCategories, expected List of Enum, found value foo that is not in Other,Discretionary,Mandatory,Continuation,Earmark');
});
it('throws an error when Number filter-type is not a number', async () => {
const badFilters = {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/db/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ function validateSearchFilters(filters) {
opportunityNumber: { type: 'String', valueType: 'Any' },
fundingTypes: { type: 'List', valueType: 'Enum', values: ['CA', 'G', 'PC', 'O'] },
opportunityStatuses: { type: 'List', valueType: 'Enum', values: ['posted', 'forecasted', 'closed', 'archived'] },
opportunityCategories: { type: 'List', valueType: 'Enum', values: ['Other', 'Discretionary', 'Mandatory', 'Continuation'] },
opportunityCategories: { type: 'List', valueType: 'Enum', values: ['Other', 'Discretionary', 'Mandatory', 'Continuation', 'Earmark'] },
costSharing: { type: 'String', valueType: 'Enum', values: ['Yes', 'No'] },
agencyCode: { type: 'String', valueType: 'Any' },
postedWithinDays: { type: 'number', valueType: 'Any' },
Expand Down
Loading