Skip to content
Snippets Groups Projects
Commit fb23135d authored by Nithya's avatar Nithya
Browse files
TMSS-268 changes reverted
parent 49650fe1
No related branches found
No related tags found
1 merge request!191Resolve TMSS-243
......@@ -37,33 +37,29 @@ class SchedulingUnitList extends Component{
}
}
async getSchedulingUnitList () {
const bluePrint = await ScheduleService.getSchedulingUnitBlueprint();
componentDidMount(){
ScheduleService.getSchedulingUnitDraft().then(scheduleunit =>{
console.log(scheduleunit)
var scheduleunits = scheduleunit.data.results;
for( const scheduleunit of scheduleunits){
const blueprintdata = bluePrint.data.results.find(i => i.draft_id === scheduleunit.id);
scheduleunit['actionpath']='/schedulingunit/view';
scheduleunit['start_time'] = blueprintdata.start_time;
scheduleunit['stop_time'] = blueprintdata.stop_time;
scheduleunit['actionpath']='/schedulingunit/view'
}
this.setState({
scheduleunit : scheduleunit.data ,isLoading:false
scheduleunit : scheduleunit.data ,isLoading: false
});
})
}
componentDidMount(){
this.getSchedulingUnitList();
}
render(){
if (this.state.isLoading) {
return <AppLoader/>
}
return(
<>
{
{
/*
* Call View table to show table data, the parameters are,
data - Pass API data
......@@ -74,7 +70,7 @@ class SchedulingUnitList extends Component{
paths - specify the path for navigation - Table will set "id" value for each row in action button
*/}
{this.state.scheduleunit.results &&
{this.state.scheduleunit.results &&
<ViewTable
data={this.state.scheduleunit.results}
defaultcolumns={this.state.defaultcolumns}
......
......@@ -14,16 +14,6 @@ const ScheduleService = {
});
return res;
},
getSchedulingUnitBlueprint: async function (){
let res = [];
await axios.get('/api/scheduling_unit_blueprint/?ordering=id')
.then(response => {
res= response;
}).catch(function(error) {
console.error('[schedule.services.getSchedulingUnitBlueprint]',error);
});
return res;
},
getSchedulingUnitDraftById: async function (id){
let res = [];
await axios.get('/api/scheduling_unit_draft/'+id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment