File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
client/containers/Departments Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ import PageContent from 'components/PageContent'
2626
2727import UIKit from 'uikit'
2828import helpers from 'lib/helpers'
29+ import { Helmet } from 'react-helmet-async'
30+ import TitleContext from 'app/TitleContext'
2931
3032class DepartmentsContainer extends React . Component {
3133 componentDidMount ( ) {
@@ -63,6 +65,13 @@ class DepartmentsContainer extends React.Component {
6365 render ( ) {
6466 return (
6567 < div >
68+ < TitleContext . Consumer >
69+ { ( { title } ) => (
70+ < Helmet >
71+ < title > { title } Departments</ title >
72+ </ Helmet >
73+ ) }
74+ </ TitleContext . Consumer >
6675 < PageTitle
6776 title = { 'Departments' }
6877 shadow = { false }
Original file line number Diff line number Diff line change 1414
1515import { DepartmentModel } from '../../../models'
1616import apiUtils from '../apiUtils'
17+ import logger from '../../../logger'
1718
1819const apiDepartments = { }
1920
@@ -56,11 +57,11 @@ apiDepartments.update = async (req, res) => {
5657 if ( putData . allGroups ) putData . groups = [ ]
5758
5859 try {
59- let department = await DepartmentModel . findOneAndUpdate ( ( { _id : id } , putData , { new : true } ) )
60- department = await DepartmentModel . populate ( 'teams groups' )
60+ const department = await DepartmentModel . findOneAndUpdate ( { _id : id } , putData , { new : true } )
6161
6262 return apiUtils . sendApiSuccess ( res , { department } )
6363 } catch ( e ) {
64+ logger . debug ( e )
6465 return apiUtils . sendApiError ( res , 500 , e . message )
6566 }
6667}
You can’t perform that action at this time.
0 commit comments