@@ -187,7 +187,7 @@ public function post()
187187 Logger::log ($ e ->getMessage (), LOG_CRIT , $ context );
188188 }
189189
190- return $ this ->json (new JsonResponse ($ model , $ saved , $ saved , 0 , $ message ), $ status );
190+ return $ this ->json (new JsonResponse ($ model , $ saved , $ saved ? 1 : 0 , 0 , $ message ), $ status );
191191 }
192192
193193 /**
@@ -241,7 +241,7 @@ public function put($pk)
241241 $ message = t ('Referenced model for update was not found ' );
242242 }
243243
244- return $ this ->json (new JsonResponse ($ model , $ updated , $ updated , 0 , $ message ), $ status );
244+ return $ this ->json (new JsonResponse ($ model , $ updated , $ updated ? 1 : 0 , 0 , $ message ), $ status );
245245 }
246246
247247 /**
@@ -283,7 +283,7 @@ public function delete($pk = null)
283283 }
284284 }
285285
286- return $ this ->json (new JsonResponse (null , $ deleted , $ deleted , 0 , $ message ), ($ deleted ) ? 200 : 400 );
286+ return $ this ->json (new JsonResponse (null , $ deleted , $ deleted ? 1 : 0 , 0 , $ message ), ($ deleted ) ? 200 : 400 );
287287 }
288288
289289 /**
@@ -321,6 +321,9 @@ private function extractDataWithFormat()
321321 {
322322 $ return = [];
323323 $ modelPk = ApiHelper::extractPrimaryKeyColumnName ($ this ->getTableMap ());
324+ if (!$ modelPk instanceof \Propel \Runtime \Map \ColumnMap) {
325+ return $ return ;
326+ }
324327 foreach ($ this ->list ->getData () as $ data ) {
325328 $ return [] = ApiHelper::mapArrayObject ($ this ->getModelNamespace (), $ modelPk , $ this ->query , $ data );
326329 }
0 commit comments