Skip to content
Open
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
6 changes: 5 additions & 1 deletion essentialism/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export default function App() {
<Route exact path="/users/:id" component={User} />
<Route exact path="/fetch" component={TestProjectsFetch} />
<Route exact path="/" component={Login} />


{/*
Build a PrivateRoute component that will
display Projects when you're authenticated
*/}

</div>
</Router>
Expand Down
8 changes: 0 additions & 8 deletions essentialism/src/components/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ import { axiosWithAuth } from '../utils/axiosWithAuth';
import { POST_DATA, POST_SUCCESS } from '../action/action';


// const initialProject = {
// project: "",
// "title": "",
// "summary": "",
// "importance": "",
// "values": {value_name: ""}

// };

const Projects = ({ projectToEdit, setProjectToEdit, editing, setEditing, initialProject}) => {
[projectToEdit, setProjectToEdit] = useState(initialProject);
Expand Down
2 changes: 1 addition & 1 deletion essentialism/src/components/TestProjectsFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ useEffect(() => {
<p> Importance: {project.importance}</p>
{/* <p> Value 1: {project.values[0].value_name}</p> */}
<h4>Value 1: {project.values[0].value_name}</h4>
<h4>Value 1: {project.values[1].value_name}</h4>
<h4>Value 2: {project.values[1].value_name}</h4>

<button onClick={removeProject(project.id)}>Remove Projects</button>
<button onClick={()=> editProject(project)}> Edit Project </button>
Expand Down
4 changes: 3 additions & 1 deletion essentialism/src/reducer/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ const projectsReducer = (state = initialState, actions) => {
return item
} else return state.projects
})
}
}



default:
return state
Expand Down