Merge pull request #17522 from seamuslee001/remove_deprecated_methods
[civicrm-core.git] / api / v3 / Dashboard.php
index e38ead835360c060d43b127338c5bb6cef906574..4fa78a46e6f5428a166670aa4b0220470cc50682 100644 (file)
@@ -65,12 +65,8 @@ function civicrm_api3_dashboard_get($params) {
  *   Array holding 'id' of dashlet to be deleted.
  * @return array
  * @throws API_Exception
+ * @throws CiviCRM_API3_Exception
  */
 function civicrm_api3_dashboard_delete($params) {
-  if (CRM_Core_BAO_Dashboard::deleteDashlet($params['id'])) {
-    return civicrm_api3_create_success(1, $params, 'Dashboard', 'delete');
-  }
-  else {
-    throw new API_Exception('Could not delete dashlet');
-  }
+  return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }