Skip to content

Commit

Permalink
GIFT-187 GIFT-246
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewNatoli committed Oct 25, 2017
1 parent 4378df7 commit bfdb4b3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
1 change: 0 additions & 1 deletion react-ui/src/app/dashboard/household/householdIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export default class HouseholdIndex extends React.Component<{}> {
<Row>
<Col xs={12}>
<Box title="Household List">

<List user={this.props.user} openHouseholdReview={this.openHouseholdReview} ref={(el) => this.listComponent = el}/>
</Box>
</Col>
Expand Down
22 changes: 11 additions & 11 deletions react-ui/src/app/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ export default class Dashboard extends React.Component<{location: mixed}, {user:
<Switch location={this.props.location}>
<Route exact path="/dashboard" component={() => <Home user={user}/>} />
{/* Needs Redux */}
<Route exact path="/dashboard/household" component={() => <HouseholdIndex user={user}/>} />
<Route exact path="/dashboard/household/create" component={() => <NewHousehold user={user}/>} />
<Route exact path="/dashboard/household/show/:id" component={() => <ShowHousehold user={user}/>} />
<Route exact path="/dashboard/household/edit/:id" component={() => <NewHousehold user={user}/>} />
<Route exact path="/dashboard/affiliation" component={() => <AffiliationList user={user}/>} />
<Route exact path="/dashboard/affiliation/:affiliation_id" component={() => <Affiliation user={user}/>} />
<Route exact path="/dashboard/user" component={() => <UsersList user={user}/>} />
<Route exact path="/dashboard/user/pending" component={() => <PendingUsersList user={user}/>} />
<Route exact path="/dashboard/user/create" component={() => <NewUser user={user}/>} />
<Route exact path="/dashboard/user/:user_id/edit" component={() => <EditUser user={user}/>} />
<Route exact path="/dashboard/user/:user_id" component={() => <ViewUser user={user}/>} />
<Route exact path="/dashboard/household" component={(rest) => <HouseholdIndex user={user} {...rest}/>} />
<Route exact path="/dashboard/household/create" component={(rest) => <NewHousehold user={user} {...rest} />} />
<Route exact path="/dashboard/household/show/:id" component={(rest) => <ShowHousehold user={user} {...rest} />} />
<Route exact path="/dashboard/household/edit/:id" component={(rest) => <NewHousehold user={user} {...rest} />} />
<Route exact path="/dashboard/affiliation" component={(rest) => <AffiliationList user={user} {...rest} />} />
<Route exact path="/dashboard/affiliation/:affiliation_id" component={(rest) => <Affiliation user={user} {...rest} />} />
<Route exact path="/dashboard/user" component={(rest) => <UsersList user={user} {...rest} />} />
<Route exact path="/dashboard/user/pending" component={(rest) => <PendingUsersList user={user} {...rest} />} />
<Route exact path="/dashboard/user/create" component={(rest) => <NewUser user={user} {...rest} />} />
<Route exact path="/dashboard/user/:user_id/edit" component={(rest) => <EditUser user={user} {...rest} />} />
<Route exact path="/dashboard/user/:user_id" component={(rest) => <ViewUser user={user} {...rest} />} />
</Switch>
</section>
</div>
Expand Down
4 changes: 4 additions & 0 deletions server/apps/nominations/controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ module.exports = {
newData.password = auth.hashPassword(user.password);
}

if (req.user.role !== 'admin') {
newData.role = existingUser.role;
}

existingUser.update(newData).then(() => {
res.json({ data: true });
}).catch((err) => {
Expand Down

0 comments on commit bfdb4b3

Please sign in to comment.