-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from PhilanthropyDataCommons/101-deep-proposa…
…l-by-id-2 Add option to deep GET /proposals/{proposalId}
- Loading branch information
Showing
10 changed files
with
822 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/database/queries/applicationFormFields/selectByProposalId.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SELECT aff.id AS "id", | ||
aff.application_form_id AS "applicationFormId", | ||
aff.canonical_field_id AS "canonicalFieldId", | ||
aff.position AS "position", | ||
aff.label AS "label", | ||
aff.created_at AS "createdAt" | ||
FROM application_form_fields aff | ||
INNER JOIN proposal_field_values pfv | ||
ON pfv.application_form_field_id = aff.id | ||
INNER JOIN proposal_versions pv | ||
ON pv.id = pfv.proposal_version_id | ||
WHERE pv.proposal_id = :proposalId | ||
ORDER BY pv.version DESC, pfv.position; |
11 changes: 11 additions & 0 deletions
11
src/database/queries/proposalFieldValues/selectByProposalId.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
SELECT pfv.id AS "id", | ||
pfv.proposal_version_id AS "proposalVersionId", | ||
pfv.application_form_field_id AS "applicationFormFieldId", | ||
pfv.value AS "value", | ||
pfv.position AS "position", | ||
pfv.created_at AS "createdAt" | ||
FROM proposal_field_values pfv | ||
INNER JOIN proposal_versions pv | ||
ON pv.id = pfv.proposal_version_id | ||
WHERE pv.proposal_id = :proposalId | ||
ORDER BY pv.version DESC, pfv.position; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
SELECT pv.id AS "id", | ||
pv.proposal_id AS "proposalId", | ||
pv.application_form_id AS "applicationFormId", | ||
pv.version AS "version", | ||
pv.created_at AS "createdAt" | ||
FROM proposal_versions pv | ||
WHERE pv.proposal_id = :proposalId | ||
ORDER BY pv.version DESC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export class NotFoundError extends Error { | ||
public constructor( | ||
message: string, | ||
) { | ||
super(message); | ||
this.name = this.constructor.name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.