-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alter db query for get project by Id
Relates #11 Co-authored-by: Hannah Gooding <[email protected]>
1 parent
bbe27d1
commit b7b7cc2
Showing
3 changed files
with
37 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react"; | ||
import { projectPage } from "../../utils/get-fetch"; | ||
|
||
const ProjectPage = () => { | ||
const [projectData, setProjectData] = React.useState([]); | ||
|
||
React.useEffect(() => { | ||
projectPage().then(setProjectData); | ||
}, []); | ||
|
||
const { | ||
id, | ||
user_id, | ||
project_name, | ||
project_description, | ||
project_status, | ||
} = projectData; | ||
// SELECT (SELECT username FROM users WHERE projects.user_id=users.id), project_name, project_description, project_status, steps.step_name, steps.step_link, steps.date, feedback_text, feedback_tag, feedback.date | ||
// FROM projects JOIN users ON projects.user_id=users.id JOIN steps ON projects.id=steps.project_id JOIN feedback ON steps.id=feedback.step_id | ||
// WHERE projects.id = 1; | ||
}; | ||
|
||
export default ProjectPage; |
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
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