瀏覽代碼

API status code fix
apis currently returning 404 if no entry found fixed

Fabian Heinz 1 年之前
父節點
當前提交
aa43e18d56

+ 0 - 3
htdocs/adherents/class/api_members.class.php

@@ -271,9 +271,6 @@ class Members extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieve member list : '.$this->db->lasterror());
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No member found');
-		}
 
 		return $obj_ret;
 	}

+ 1 - 3
htdocs/expedition/class/api_shipments.class.php

@@ -179,9 +179,7 @@ class Shipments extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieve commande list : '.$this->db->lasterror());
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No shipment found');
-		}
+
 		return $obj_ret;
 	}
 

+ 1 - 3
htdocs/fourn/class/api_supplier_invoices.class.php

@@ -193,9 +193,7 @@ class SupplierInvoices extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieve supplier invoice list : ' . $this->db->lasterror());
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No supplier invoice found');
-		}
+
 		return $obj_ret;
 	}
 

+ 1 - 3
htdocs/fourn/class/api_supplier_orders.class.php

@@ -215,9 +215,7 @@ class SupplierOrders extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieve supplier order list : '.$this->db->lasterror());
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No supplier order found');
-		}
+
 		return $obj_ret;
 	}
 

+ 1 - 3
htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php

@@ -231,9 +231,7 @@ class KnowledgeManagement extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieving knowledgerecord list: '.$this->db->lasterror());
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No knowledgerecord found');
-		}
+		
 		return $obj_ret;
 	}
 

+ 0 - 3
htdocs/multicurrency/class/api_multicurrencies.class.php

@@ -102,9 +102,6 @@ class MultiCurrencies extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieve currencies list : '.$this->db->lasterror());
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No currencies found');
-		}
 
 		return $obj_ret;
 	}

+ 1 - 3
htdocs/projet/class/api_projects.class.php

@@ -190,9 +190,7 @@ class Projects extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieve project list : '.$this->db->lasterror());
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No project found');
-		}
+
 		return $obj_ret;
 	}
 

+ 1 - 3
htdocs/projet/class/api_tasks.class.php

@@ -185,9 +185,7 @@ class Tasks extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieve task list : '.$this->db->lasterror());
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No task found');
-		}
+
 		return $obj_ret;
 	}
 

+ 1 - 3
htdocs/reception/class/api_receptions.class.php

@@ -178,9 +178,7 @@ class Receptions extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieve commande list : '.$this->db->lasterror());
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No reception found');
-		}
+
 		return $obj_ret;
 	}
 

+ 1 - 3
htdocs/supplier_proposal/class/api_supplier_proposals.class.php

@@ -171,9 +171,7 @@ class SupplierProposals extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieving supplier proposal list : '.$this->db->lasterror());
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No supplier proposal found');
-		}
+
 		return $obj_ret;
 	}
 

+ 1 - 3
htdocs/zapier/class/api_zapier.class.php

@@ -230,9 +230,7 @@ class Zapier extends DolibarrApi
 		} else {
 			throw new RestException(503, 'Error when retrieve hook list');
 		}
-		if (!count($obj_ret)) {
-			throw new RestException(404, 'No hook found');
-		}
+		
 		return $obj_ret;
 	}