tailjng 0.0.57 → 0.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,7 @@ Authors:
27
27
  License:
28
28
  This project is licensed under the BSD 3-Clause - see the LICENSE file for more details.
29
29
 
30
- Version: 0.0.57
30
+ Version: 0.0.58
31
31
  Creation Date: 2025-01-04
32
32
  ===============================================`
33
33
 
@@ -963,6 +963,20 @@ class JGenericCrudService {
963
963
  const url = urlBase ? `${urlBase}/${endpoint}` : `${this.config.urlBase}/${endpoint}`;
964
964
  return this.http.get(`${url}/${id}`).pipe(map(response => response.data[endpoint]));
965
965
  }
966
+ /**
967
+ * Method to count the records of an endpoint.
968
+ * @param urlBase Base URL for the request.
969
+ * @param endpoint Distinctive of the endpoint ('role', 'status', etc.)
970
+ * @param params Parameters of the request.
971
+ * @returns Observable with the API response.
972
+ */
973
+ count({ urlBase, endpoint, params }) {
974
+ const url = urlBase ? `${urlBase}/${endpoint}` : `${this.config.urlBase}/${endpoint}`;
975
+ let httpParams;
976
+ if (params)
977
+ httpParams = this.paramsHttpService.resParams(params);
978
+ return this.http.get(`${url}/count`, { params: httpParams });
979
+ }
966
980
  /**
967
981
  * Method to create a record in an endpoint.
968
982
  * @param urlBase Base URL for the request.