Skip to content
This repository was archived by the owner on Aug 8, 2019. It is now read-only.

Commit 9af6b3a

Browse files
author
Lian Nivin
authored
Merge pull request #69 from codeableorg/hotfix-nan-project
Fix NAN progress in new project and User Context missing
2 parents 948f336 + a13413d commit 9af6b3a

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

rails-time-track/app/controllers/api/projects_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def create
3232
start_date: params[:start_date],
3333
end_date: params[:end_date],
3434
estimated_cost: params[:estimated_cost],
35-
real_cost: params[:real_cost],
35+
real_cost: 0,
3636
closed: false,)
3737
if project.save
3838
if params[:members].all? do |member|

react-time-track/src/components/list-member-project.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ function ListMemberProject({ nextFn, beforeFn }) {
7474
const endDate = infoProject.end;
7575
userListAvailableTime({ startDate, endDate })
7676
.then(response => {
77-
console.log(response);
7877
setListMember(response);
7978
})
8079
.catch(response => {

react-time-track/src/components/list-projects.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ function ListProjects() {
2727
.catch(response => logged.onLogout());
2828
}, []);
2929

30-
// console.log("Projects:", projects);
31-
3230
return (
3331
<main>
3432
<Section role="list">

react-time-track/src/components/list-user-projects.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { listUserProjects } from "../services/project";
99

1010
import calculateProgress from "../utils/calculateProgress";
1111
import calculateRisk from "../utils/calculateRisk";
12+
import { UserContext } from "../contexts/user";
1213

1314
const card = {
1415
display: "flex",
@@ -18,6 +19,7 @@ const card = {
1819

1920
function ListUserProjects() {
2021
const [userProjects, setUserProjects] = React.useState([]);
22+
const logged = React.useContext(UserContext);
2123

2224
React.useEffect(() => {
2325
listUserProjects()
@@ -27,10 +29,6 @@ function ListUserProjects() {
2729
});
2830
}, []);
2931

30-
React.useEffect(() => {
31-
console.log(userProjects);
32-
}, [userProjects]);
33-
3432
return (
3533
<main>
3634
<Section role="list">

0 commit comments

Comments
 (0)