File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed 
src/components/contractors Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 11{
22  "name" : " tutorcruncher-socket" 
3-   "version" : " 1.1 .0" 
3+   "version" : " 1.2 .0" 
44  "description" : " TutorCruncher socket" 
55  "author" : 
" Samuel Colvin <[email protected] >" ,
 66  "private" : false ,
Original file line number Diff line number Diff line change 3232    </ main > 
3333  </ body > 
3434  < script > 
35-     window . socket  =  socket ( '9c79f14df986a1ec693c' ) 
35+     var  public_key  =  '9c79f14df986a1ec693c' 
36+     var  api_root  =  null   // 'https://socket-beta.tutorcruncher.com' 'http://localhost:8000' 
37+     window . socket  =  socket ( public_key ,  { api_root : api_root } ) 
3638  </ script > 
3739</ html > 
Original file line number Diff line number Diff line change @@ -76,7 +76,13 @@ class Contractors extends Component {
7676      pagination : this . props . config . pagination , 
7777      page : page , 
7878    } ) 
79-     const  contractors  =  await  this . props . root . requests . get ( 'contractors' ,  args ) 
79+     const  data  =  await  this . props . root . requests . get ( 'contractors' ,  args ) 
80+     let  contractors 
81+     if  ( Array . isArray ( data ) )  { 
82+       contractors  =  data 
83+     }  else  { 
84+       contractors  =  data . results 
85+     } 
8086    this . props . config . event_callback ( 'updated_contractors' ,  contractors ) 
8187    this . setState ( { contractors : [ ] } ) 
8288    setTimeout ( ( )  =>  this . setState ( { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments