Skip to content

Commit e990585

Browse files
authored
Merge pull request #8 from bcgov/feature/mv6020-fetch-form-numbers
Add logic to fetch MV6020 numbers
2 parents 7276d13 + 70b41d0 commit e990585

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const REACT_APP_FORM_ID_12HOUR_LIMIT = (window._env_ && window._env_.REACT_APP_FORM_ID_12HOUR_LIMIT) || 5;
22
export const REACT_APP_FORM_ID_24HOUR_LIMIT = (window._env_ && window._env_.REACT_APP_FORM_ID_24HOUR_LIMIT) || 5;
3-
export const REACT_APP_FORM_ID_VI_LIMIT = (window._env_ && window._env_.REACT_APP_FORM_ID_VI_LIMIT) || 5;
3+
export const REACT_APP_FORM_ID_VI_LIMIT = (window._env_ && window._env_.REACT_APP_FORM_ID_VI_LIMIT) || 5;
4+
export const REACT_APP_FORM_ID_MV6020_LIMIT = (window._env_ && window._env_.REACT_APP_FORM_ID_MV6020_LIMIT) || 5;

forms-flow-rsbcservice/src/storage/dbInsertServices.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { getUserRoles } from "../request/getUserRolesApi";
1616
import {
1717
REACT_APP_FORM_ID_12HOUR_LIMIT,
1818
REACT_APP_FORM_ID_24HOUR_LIMIT,
19+
REACT_APP_FORM_ID_MV6020_LIMIT,
1920
REACT_APP_FORM_ID_VI_LIMIT,
2021
} from "./config";
2122

@@ -228,11 +229,16 @@ class OfflineSaveService {
228229
0,
229230
REACT_APP_FORM_ID_VI_LIMIT - (countByFormType["VI"] || 0)
230231
);
232+
const requiredMV6020 = Math.max(
233+
0,
234+
REACT_APP_FORM_ID_MV6020_LIMIT - (countByFormType["MV6020"] || 0)
235+
);
231236
try {
232237
const requiredIds = {
233238
"12Hour": required12Hour,
234239
"24Hour": required24Hour,
235-
VI: requiredVI,
240+
"VI": requiredVI,
241+
"MV6020": requiredMV6020,
236242
};
237243

238244
await fetchFormIDs(

0 commit comments

Comments
 (0)