react-native-timacare 3.3.46 → 3.3.47
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.
- package/lib/commonjs/assets/svgs/question.svg +1 -7
- package/lib/commonjs/components/ItemTimaOneV3.js +1 -1
- package/lib/commonjs/components/ItemTimaOneV3.js.flow +29 -29
- package/lib/commonjs/components/ItemTimaOneV3.js.map +1 -1
- package/lib/commonjs/components/SkeletonLoanCard.js +1 -1
- package/lib/commonjs/components/SkeletonLoanCard.js.flow +58 -0
- package/lib/commonjs/components/SkeletonLoanCard.js.map +1 -1
- package/lib/commonjs/navigation/primary-navigator.js +1 -1
- package/lib/commonjs/navigation/primary-navigator.js.flow +1 -1
- package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
- package/lib/commonjs/screens/detail-loan-tima/InforLoan.js +2 -0
- package/lib/commonjs/screens/detail-loan-tima/InforLoan.js.flow +199 -0
- package/lib/commonjs/screens/detail-loan-tima/InforLoan.js.map +1 -0
- package/lib/commonjs/screens/detail-loan-tima/PaymentSchedule.js +2 -0
- package/lib/commonjs/screens/{detail-loan/DetailLoanTima.js.flow → detail-loan-tima/PaymentSchedule.js.flow} +107 -118
- package/lib/commonjs/screens/detail-loan-tima/PaymentSchedule.js.map +1 -0
- package/lib/commonjs/screens/detail-loan-tima/index.js +2 -0
- package/lib/commonjs/screens/detail-loan-tima/index.js.flow +109 -0
- package/lib/commonjs/screens/detail-loan-tima/index.js.map +1 -0
- package/lib/commonjs/screens/home/DigitalTopupItem.js +1 -1
- package/lib/commonjs/screens/home/DigitalTopupItem.js.flow +2 -2
- package/lib/commonjs/screens/home/DigitalTopupItem.js.map +1 -1
- package/lib/commonjs/screens/home/ItemMotoBikeLoan.js +1 -1
- package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.flow +2 -2
- package/lib/commonjs/services/api/api.js +1 -1
- package/lib/commonjs/services/api/api.js.flow +33 -7
- package/lib/commonjs/services/api/api.js.map +1 -1
- package/lib/module/assets/svgs/question.svg +1 -7
- package/lib/module/components/ItemTimaOneV3.js +1 -1
- package/lib/module/components/ItemTimaOneV3.js.map +1 -1
- package/lib/module/components/SkeletonLoanCard.js +1 -1
- package/lib/module/components/SkeletonLoanCard.js.map +1 -1
- package/lib/module/navigation/primary-navigator.js +1 -1
- package/lib/module/navigation/primary-navigator.js.map +1 -1
- package/lib/module/screens/detail-loan-tima/InforLoan.js +2 -0
- package/lib/module/screens/detail-loan-tima/InforLoan.js.map +1 -0
- package/lib/module/screens/detail-loan-tima/PaymentSchedule.js +2 -0
- package/lib/module/screens/detail-loan-tima/PaymentSchedule.js.map +1 -0
- package/lib/module/screens/detail-loan-tima/index.js +2 -0
- package/lib/module/screens/detail-loan-tima/index.js.map +1 -0
- package/lib/module/screens/home/DigitalTopupItem.js +1 -1
- package/lib/module/screens/home/DigitalTopupItem.js.map +1 -1
- package/lib/module/screens/home/ItemMotoBikeLoan.js +1 -1
- package/lib/module/services/api/api.js +1 -1
- package/lib/module/services/api/api.js.map +1 -1
- package/lib/typescript/components/SkeletonLoanCard.d.ts +3 -0
- package/lib/typescript/components/SkeletonLoanCard.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan-tima/InforLoan.d.ts +4 -0
- package/lib/typescript/screens/detail-loan-tima/InforLoan.d.ts.map +1 -0
- package/lib/typescript/screens/detail-loan-tima/PaymentSchedule.d.ts +2 -0
- package/lib/typescript/screens/detail-loan-tima/PaymentSchedule.d.ts.map +1 -0
- package/lib/typescript/screens/detail-loan-tima/index.d.ts +2 -0
- package/lib/typescript/screens/detail-loan-tima/index.d.ts.map +1 -0
- package/lib/typescript/services/api/api.d.ts +16 -0
- package/lib/typescript/services/api/api.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/assets/svgs/question.svg +1 -7
- package/src/components/ItemTimaOneV3.tsx +29 -29
- package/src/components/SkeletonLoanCard.tsx +58 -0
- package/src/navigation/primary-navigator.tsx +1 -1
- package/src/screens/detail-loan-tima/InforLoan.tsx +199 -0
- package/src/screens/{detail-loan/DetailLoanTima.tsx → detail-loan-tima/PaymentSchedule.tsx} +107 -118
- package/src/screens/detail-loan-tima/index.tsx +109 -0
- package/src/screens/home/DigitalTopupItem.tsx +2 -2
- package/src/screens/home/ItemMotoBikeLoan.tsx +2 -2
- package/src/services/api/api.ts +33 -7
- package/lib/commonjs/screens/detail-loan/DetailLoanTima.js +0 -2
- package/lib/commonjs/screens/detail-loan/DetailLoanTima.js.map +0 -1
- package/lib/module/screens/detail-loan/DetailLoanTima.js +0 -2
- package/lib/module/screens/detail-loan/DetailLoanTima.js.map +0 -1
- package/lib/typescript/screens/detail-loan/DetailLoanTima.d.ts +0 -2
- package/lib/typescript/screens/detail-loan/DetailLoanTima.d.ts.map +0 -1
|
@@ -124,10 +124,15 @@ export class Api {
|
|
|
124
124
|
text: 'Đồng ý',
|
|
125
125
|
onPress: () => {
|
|
126
126
|
try {
|
|
127
|
-
if (
|
|
127
|
+
if (
|
|
128
|
+
this.config.logout &&
|
|
129
|
+
typeof this.config.logout === 'function'
|
|
130
|
+
) {
|
|
128
131
|
this.config.logout();
|
|
129
132
|
} else {
|
|
130
|
-
myLog(
|
|
133
|
+
myLog(
|
|
134
|
+
'[API] Warning: logout function not configured in SDKConfig'
|
|
135
|
+
);
|
|
131
136
|
}
|
|
132
137
|
} catch (error) {
|
|
133
138
|
myLog('[API] Error during logout:', error);
|
|
@@ -222,14 +227,14 @@ export class Api {
|
|
|
222
227
|
// Seed current state, then listen for changes.
|
|
223
228
|
netInfo
|
|
224
229
|
.fetch()
|
|
225
|
-
.then(state => {
|
|
230
|
+
.then((state) => {
|
|
226
231
|
this.isConnected = state.isConnected !== false;
|
|
227
232
|
})
|
|
228
233
|
.catch(() => {
|
|
229
234
|
this.isConnected = true;
|
|
230
235
|
});
|
|
231
236
|
|
|
232
|
-
this.netInfoUnsubscribe = netInfo.addEventListener(state => {
|
|
237
|
+
this.netInfoUnsubscribe = netInfo.addEventListener((state) => {
|
|
233
238
|
this.isConnected = state.isConnected !== false;
|
|
234
239
|
});
|
|
235
240
|
}
|
|
@@ -241,7 +246,10 @@ export class Api {
|
|
|
241
246
|
* 2. Shortens the timeout for idempotent GETs on the main instance so reads
|
|
242
247
|
* fail fast and hand off to the retry interceptor.
|
|
243
248
|
*/
|
|
244
|
-
private attachRequestGuards(
|
|
249
|
+
private attachRequestGuards(
|
|
250
|
+
instance: ApisauceInstance,
|
|
251
|
+
splitGetTimeout: boolean
|
|
252
|
+
) {
|
|
245
253
|
const getTimeout = this.config.getTimeout || DEFAULT_GET_TIMEOUT;
|
|
246
254
|
|
|
247
255
|
instance.axiosInstance.interceptors.request.use((config: any) => {
|
|
@@ -276,7 +284,7 @@ export class Api {
|
|
|
276
284
|
*/
|
|
277
285
|
private attachRetryInterceptor(instance: ApisauceInstance) {
|
|
278
286
|
instance.axiosInstance.interceptors.response.use(
|
|
279
|
-
response => response,
|
|
287
|
+
(response) => response,
|
|
280
288
|
async (error: any) => {
|
|
281
289
|
const config = error?.config;
|
|
282
290
|
|
|
@@ -305,7 +313,7 @@ export class Api {
|
|
|
305
313
|
`[API] Retry ${config.__retryCount}/${MAX_RETRIES} in ${delay}ms: ${config.url}`
|
|
306
314
|
);
|
|
307
315
|
|
|
308
|
-
await new Promise(resolve => setTimeout(resolve, delay));
|
|
316
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
309
317
|
return instance.axiosInstance(config);
|
|
310
318
|
}
|
|
311
319
|
);
|
|
@@ -4161,4 +4169,22 @@ export class Api {
|
|
|
4161
4169
|
return { kind: 'bad-data' };
|
|
4162
4170
|
}
|
|
4163
4171
|
}
|
|
4172
|
+
|
|
4173
|
+
async get_detail_loan_tima(id) {
|
|
4174
|
+
// make the api call
|
|
4175
|
+
const response: ApiResponse<any> = await this.apisauce.get(
|
|
4176
|
+
`api/v2.0/loanbrief/get_loan_detail_tima?loanBriefId=${id}`
|
|
4177
|
+
);
|
|
4178
|
+
// the typical ways to die when calling an api
|
|
4179
|
+
if (!response.ok) {
|
|
4180
|
+
const problem = getGeneralApiProblem(response);
|
|
4181
|
+
if (problem) return problem;
|
|
4182
|
+
}
|
|
4183
|
+
// transform the data into the format we are expecting
|
|
4184
|
+
try {
|
|
4185
|
+
return { kind: 'ok', data: response.data };
|
|
4186
|
+
} catch {
|
|
4187
|
+
return { kind: 'bad-data' };
|
|
4188
|
+
}
|
|
4189
|
+
}
|
|
4164
4190
|
}
|