Fix double deleteAttributeValueByRef

This commit is contained in:
Cédric 2019-11-21 18:18:11 +01:00 committed by GitHub
parent 351ba58bbe
commit 5a3f78088e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1262,32 +1262,6 @@ class Products extends DolibarrApi
throw new RestException(500, "Error deleting attribute value");
}
/**
* Delete attribute value by ref.
*
* @param string $ref Ref of Attribute value
* @return int
*
* @throws RestException
* @throws 401
*
* @url DELETE attributes/values/ref/{ref}
*/
public function deleteAttributeValueByRef($ref)
{
if(! DolibarrApiAccess::$user->rights->produit->supprimer) {
throw new RestException(401);
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE ref LIKE '". trim($ref) ."'";
if ($this->db->query($sql)) {
return 1;
}
throw new RestException(500, "Error deleting attribute value");
}
/**
* Get product variants.
*