ngx-dsxlibrary 1.21.40 → 1.21.41
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.
|
Binary file
|
package/package.json
CHANGED
|
@@ -1611,6 +1611,36 @@ declare class UtilityAddService {
|
|
|
1611
1611
|
* - Muestra alerta visual personalizada con icono de error.
|
|
1612
1612
|
*/
|
|
1613
1613
|
handleResponse(response: ResponseHttpModel, urlHome: string, form: FormGroup, getForm: () => void, id: number): void;
|
|
1614
|
+
/**
|
|
1615
|
+
* Maneja la respuesta estándar de una operación HTTP que devuelve un ServiceResult<T>,
|
|
1616
|
+
* mostrando alertas y realizando acciones comunes en formularios.
|
|
1617
|
+
*
|
|
1618
|
+
* @typeParam T - Tipo de dato contenido en la propiedad data de ServiceResult.
|
|
1619
|
+
* @param response - Respuesta del servicio (debe tener isSuccess, title, message, etc.).
|
|
1620
|
+
* @param urlHome - Ruta a la que se navega si la operación es exitosa y el id es mayor a 0.
|
|
1621
|
+
* @param form - Formulario reactivo a resetear si la operación es exitosa.
|
|
1622
|
+
* @param getForm - Función para recargar el formulario (por ejemplo, para obtener datos actualizados).
|
|
1623
|
+
* @param id - Identificador usado para decidir si se navega a urlHome tras éxito.
|
|
1624
|
+
*
|
|
1625
|
+
* @example
|
|
1626
|
+
* // Uso típico en un componente con ServiceResult
|
|
1627
|
+
* this.utilityAddService.handleResponseService<MiModelo>(
|
|
1628
|
+
* response,
|
|
1629
|
+
* '/home',
|
|
1630
|
+
* this.form,
|
|
1631
|
+
* () => this.getForm(),
|
|
1632
|
+
* this.id
|
|
1633
|
+
* );
|
|
1634
|
+
*
|
|
1635
|
+
* @description
|
|
1636
|
+
* - Si response.isSuccess es true:
|
|
1637
|
+
* - Muestra alerta tipo toastr.
|
|
1638
|
+
* - Si id > 0, navega a urlHome.
|
|
1639
|
+
* - Resetea el formulario y ejecuta getForm().
|
|
1640
|
+
* - Si response.isSuccess es false:
|
|
1641
|
+
* - Muestra alerta visual personalizada con icono de error.
|
|
1642
|
+
*/
|
|
1643
|
+
handleResponseService<T>(response: ServiceResult<T>, urlHome: string, form: FormGroup, getForm: () => void, id: number): void;
|
|
1614
1644
|
static ɵfac: i0.ɵɵFactoryDeclaration<UtilityAddService, never>;
|
|
1615
1645
|
static ɵprov: i0.ɵɵInjectableDeclaration<UtilityAddService>;
|
|
1616
1646
|
}
|
|
Binary file
|