taxtank-core 0.33.57 → 0.33.58
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/src/lib/models/report/my-tax/my-tax-business-income-or-losses/my-tax-business-losses/my-tax-business-losses.mjs +5 -4
- package/esm2022/src/lib/services/http/rest/http-error-messages.const.mjs +14 -0
- package/esm2022/src/lib/services/http/rest/index.mjs +2 -1
- package/esm2022/src/lib/services/http/rest/rest.service.mjs +37 -27
- package/esm2022/src/lib/services/http/transaction/transaction-allocation/allocation-rule/allocation-rule.service.mjs +3 -1
- package/fesm2022/taxtank-core.mjs +54 -28
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/services/http/rest/http-error-messages.const.d.ts +13 -0
- package/src/lib/services/http/rest/index.d.ts +1 -0
- package/src/lib/services/http/rest/rest.service.d.ts +22 -0
- package/src/lib/services/http/transaction/transaction-allocation/allocation-rule/allocation-rule.service.d.ts +3 -0
package/package.json
CHANGED
@@ -44,6 +44,21 @@ export declare abstract class RestService<BaseModel, Model extends AbstractModel
|
|
44
44
|
protected orderByDesc: boolean;
|
45
45
|
roles: UserRolesEnum[];
|
46
46
|
mercureTopic: string;
|
47
|
+
/**
|
48
|
+
* flag to use error messages from api or default ones
|
49
|
+
* @TODO: TT-4642 check customHttpErrorMessages fix change to backend errors
|
50
|
+
*/
|
51
|
+
protected useBackendError: boolean;
|
52
|
+
/**
|
53
|
+
* messages that can be redefined in other classes to customize httpErrorMessages
|
54
|
+
*/
|
55
|
+
protected customHttpErrorMessages: {};
|
56
|
+
/**
|
57
|
+
* mapping with HTTP errors codes and general messages
|
58
|
+
*/
|
59
|
+
protected httpErrorMessages: {
|
60
|
+
[key: number]: string;
|
61
|
+
};
|
47
62
|
constructor(environment: any);
|
48
63
|
protected get apiUrl(): string;
|
49
64
|
setCache(data: any[], next?: boolean): void;
|
@@ -89,6 +104,13 @@ export declare abstract class RestService<BaseModel, Model extends AbstractModel
|
|
89
104
|
* Remove multiple Model instances from database
|
90
105
|
*/
|
91
106
|
deleteBatch(models: Model[]): Observable<void>;
|
107
|
+
/**
|
108
|
+
* Handle response errors - shows error in toast
|
109
|
+
* and throws error further
|
110
|
+
* @param error - any backend error
|
111
|
+
* @throws HttpErrorResponse | Error - Always throws the error further as an Observable<never>
|
112
|
+
*/
|
113
|
+
handleError(error: unknown): Observable<never>;
|
92
114
|
/**
|
93
115
|
* Handle response data - update cache and dispatch event if it is needed
|
94
116
|
*/
|
@@ -7,6 +7,9 @@ export declare class AllocationRuleService extends RestService<AllocationRuleBas
|
|
7
7
|
protected endpointUri: string;
|
8
8
|
collectionClass: typeof AllocationRuleCollection;
|
9
9
|
modelClass: typeof AllocationRule;
|
10
|
+
customHttpErrorMessages: {
|
11
|
+
422: string;
|
12
|
+
};
|
10
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<AllocationRuleService, never>;
|
11
14
|
static ɵprov: i0.ɵɵInjectableDeclaration<AllocationRuleService>;
|
12
15
|
}
|