Sails GET请求不会从我的Postgres DB中的所有列返回数据

时间:2015-08-04 17:41:05

标签: postgresql sails.js waterline sails-postgresql

我使用$ sailsS​​ocket来发出我的GET和POST请求。我的POST请求看起来像这样;

$sailsSocket.post('/schedules/toDateObj', 
    { jobSchedObj: 
        { repair_shop_equipment_id: response.config.data.schedEquip.rsrcId, 
          repair_history_id: response.data.id, 
          technician_id: response.data.technician_id, 
          allotted_time: response.data.allotted_time,
          times: timeObj,
          repair_shop_id: $localstorage.get('shopId')
          }
      })
      .success(function(){
          $location.path('/app/checkin');
      })
      .error(function (response){
          console.log(response);
      });

这是它保存的表格...... screen shot 2015-08-01 at 2 17 15 pm

一切都保存得很好我甚至在ScheduleController中抛出了一个console.log,用我的POST请求检查数据库中插入了什么。这是输出; screen shot 2015-08-03 at 4 41 09 pm

问题是,当我向Schedule表发出GET请求时,它会返回除repair_shop_equipment_id之外的所有内容。这是获取请求;

 var firstDay = scope.getJobsFor[0];
 var lowerBound = firstDay.open_time;
 var lastDay = scope.getJobsFor[scope.getJobsFor.length - 1];
 var upperBound = lastDay.close_time;
 $sailsSocket.get("/schedules", {params:
     {where: {
         repair_shop_id: scope.shopId,
         technician_id: scope.schedTech.id,  
         repair_shop_equipment_id: scope.schedEquip.rsrcId,
         scheduled_start_time:{ date: {'>':lowerBound, '<':upperBound}}
         }
     }
 })
 .success(function (response){

这就是回应......

screen shot 2015-08-04 at 1 24 25 pm

以下是我的关联Sails模型和计划控制器的link到Gist;

我的某个型号配置有问题吗?感谢。

0 个答案:

没有答案