@openmrs/esm-stock-management-app 1.0.1-pre.717 → 1.0.1-pre.726
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/606.js +1 -1
- package/dist/606.js.map +1 -1
- package/dist/973.js +1 -1
- package/dist/973.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +9 -9
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/stock-operations/add-stock-operation/add-stock-operation.component.tsx +7 -7
- package/src/stock-operations/add-stock-operation/base-operation-details.component.tsx +19 -5
- package/src/stock-operations/add-stock-operation/stock-operation-reference.component.tsx +5 -4
- package/src/stock-operations/add-stock-operation/stock-operation-submission.component.tsx +0 -2
- package/src/stock-operations/stock-operation.utils.tsx +1 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-dialog.component.tsx +1 -1
- package/src/stock-operations/stock-operations-table.resource.tsx +0 -1
- package/src/stock-operations/stock-operations.resource.ts +11 -6
- package/src/stock-reports/report-list/stock-reports.component.tsx +28 -3
- package/src/stock-reports/stock-reports.resource.ts +8 -2
@@ -134,10 +134,10 @@
|
|
134
134
|
"initial": true,
|
135
135
|
"entry": true,
|
136
136
|
"recorded": false,
|
137
|
-
"size":
|
137
|
+
"size": 5414017,
|
138
138
|
"sizes": {
|
139
139
|
"consume-shared": 252,
|
140
|
-
"javascript":
|
140
|
+
"javascript": 5392068,
|
141
141
|
"share-init": 252,
|
142
142
|
"runtime": 21445
|
143
143
|
},
|
@@ -154,7 +154,7 @@
|
|
154
154
|
"auxiliaryFiles": [
|
155
155
|
"main.js.map"
|
156
156
|
],
|
157
|
-
"hash": "
|
157
|
+
"hash": "716c84c3a59e3ee3",
|
158
158
|
"childrenByOrder": {}
|
159
159
|
},
|
160
160
|
{
|
@@ -348,9 +348,9 @@
|
|
348
348
|
"initial": false,
|
349
349
|
"entry": false,
|
350
350
|
"recorded": false,
|
351
|
-
"size":
|
351
|
+
"size": 16573,
|
352
352
|
"sizes": {
|
353
|
-
"javascript":
|
353
|
+
"javascript": 16573
|
354
354
|
},
|
355
355
|
"names": [],
|
356
356
|
"idHints": [],
|
@@ -364,7 +364,7 @@
|
|
364
364
|
"auxiliaryFiles": [
|
365
365
|
"606.js.map"
|
366
366
|
],
|
367
|
-
"hash": "
|
367
|
+
"hash": "4645f30c4d9bba07",
|
368
368
|
"childrenByOrder": {}
|
369
369
|
},
|
370
370
|
{
|
@@ -607,9 +607,9 @@
|
|
607
607
|
"initial": false,
|
608
608
|
"entry": false,
|
609
609
|
"recorded": false,
|
610
|
-
"size":
|
610
|
+
"size": 1755145,
|
611
611
|
"sizes": {
|
612
|
-
"javascript":
|
612
|
+
"javascript": 1754935,
|
613
613
|
"consume-shared": 210
|
614
614
|
},
|
615
615
|
"names": [],
|
@@ -623,7 +623,7 @@
|
|
623
623
|
"auxiliaryFiles": [
|
624
624
|
"973.js.map"
|
625
625
|
],
|
626
|
-
"hash": "
|
626
|
+
"hash": "320c5101238daf8b",
|
627
627
|
"childrenByOrder": {}
|
628
628
|
}
|
629
629
|
]
|
package/dist/routes.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-nav-menu","slot":"stock-sidebar-slot","component":"stockNavMenu","online":true,"offline":true},{"name":"overview-db-link","slot":"stock-page-dashboard-slot","component":"stockOverviewLink","meta":{"name":"overview","slot":"overview-dashboard-slot","title":"overview"},"order":0,"online":true,"offline":true},{"name":"stock-overview-db","slot":"overview-dashboard-slot","component":"stockOverview"},{"name":"operations-db-link","slot":"stock-page-dashboard-slot","component":"stockOperationsLink","meta":{"name":"operations","slot":"operations-dashboard-slot","title":"operations"},"order":2,"online":true,"offline":true},{"name":"stock-operations-db","slot":"operations-dashboard-slot","component":"stockOperations"},{"name":"items-db-link","slot":"stock-page-dashboard-slot","component":"stockItemsLink","meta":{"name":"items","slot":"items-dashboard-slot","title":"items"},"order":1,"online":true,"offline":true},{"name":"stock-items-db","slot":"items-dashboard-slot","component":"stockItems"},{"name":"user-scopes-db-link","slot":"stock-page-dashboard-slot","component":"stockUserScopesLink","meta":{"name":"user-scopes","slot":"user-scopes-dashboard-slot","title":"user-scopes"},"order":3,"online":true,"offline":true},{"name":"stock-user-scopes-db","slot":"user-scopes-dashboard-slot","component":"stockUserScopes"},{"name":"sources-db-link","slot":"stock-page-dashboard-slot","component":"stockSourcesLink","meta":{"name":"sources","slot":"sources-dashboard-slot","title":"Sources"},"order":2,"online":true,"offline":true},{"name":"stock-sources-db","slot":"sources-dashboard-slot","component":"stockSources"},{"name":"locations-db-link","slot":"stock-page-dashboard-slot","component":"stockLocationsLink","meta":{"name":"locations","slot":"locations-dashboard-slot","title":"Locations"},"order":4,"online":true,"offline":true},{"name":"stock-locations-db","slot":"locations-dashboard-slot","component":"stockLocations"},{"name":"reports-db-link","slot":"stock-page-dashboard-slot","component":"stockReportsLink","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"order":5,"online":true,"offline":true},{"name":"stock-reports-db","slot":"reports-dashboard-slot","component":"stockReports"},{"name":"settings-db-link","slot":"stock-page-dashboard-slot","component":"stockSettingsLink","meta":{"name":"settings","slot":"settings-dashboard-slot","title":"Settings"},"order":6,"online":true,"offline":true},{"name":"stock-settings-db","slot":"settings-dashboard-slot","component":"stockSettings"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"modals":[{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsModal"},{"name":"stock-operation-dialog","component":"stockOperationModal"}],"pages":[{"component":"root","route":"stock-management"}],"version":"1.0.1-pre.
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-nav-menu","slot":"stock-sidebar-slot","component":"stockNavMenu","online":true,"offline":true},{"name":"overview-db-link","slot":"stock-page-dashboard-slot","component":"stockOverviewLink","meta":{"name":"overview","slot":"overview-dashboard-slot","title":"overview"},"order":0,"online":true,"offline":true},{"name":"stock-overview-db","slot":"overview-dashboard-slot","component":"stockOverview"},{"name":"operations-db-link","slot":"stock-page-dashboard-slot","component":"stockOperationsLink","meta":{"name":"operations","slot":"operations-dashboard-slot","title":"operations"},"order":2,"online":true,"offline":true},{"name":"stock-operations-db","slot":"operations-dashboard-slot","component":"stockOperations"},{"name":"items-db-link","slot":"stock-page-dashboard-slot","component":"stockItemsLink","meta":{"name":"items","slot":"items-dashboard-slot","title":"items"},"order":1,"online":true,"offline":true},{"name":"stock-items-db","slot":"items-dashboard-slot","component":"stockItems"},{"name":"user-scopes-db-link","slot":"stock-page-dashboard-slot","component":"stockUserScopesLink","meta":{"name":"user-scopes","slot":"user-scopes-dashboard-slot","title":"user-scopes"},"order":3,"online":true,"offline":true},{"name":"stock-user-scopes-db","slot":"user-scopes-dashboard-slot","component":"stockUserScopes"},{"name":"sources-db-link","slot":"stock-page-dashboard-slot","component":"stockSourcesLink","meta":{"name":"sources","slot":"sources-dashboard-slot","title":"Sources"},"order":2,"online":true,"offline":true},{"name":"stock-sources-db","slot":"sources-dashboard-slot","component":"stockSources"},{"name":"locations-db-link","slot":"stock-page-dashboard-slot","component":"stockLocationsLink","meta":{"name":"locations","slot":"locations-dashboard-slot","title":"Locations"},"order":4,"online":true,"offline":true},{"name":"stock-locations-db","slot":"locations-dashboard-slot","component":"stockLocations"},{"name":"reports-db-link","slot":"stock-page-dashboard-slot","component":"stockReportsLink","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"order":5,"online":true,"offline":true},{"name":"stock-reports-db","slot":"reports-dashboard-slot","component":"stockReports"},{"name":"settings-db-link","slot":"stock-page-dashboard-slot","component":"stockSettingsLink","meta":{"name":"settings","slot":"settings-dashboard-slot","title":"Settings"},"order":6,"online":true,"offline":true},{"name":"stock-settings-db","slot":"settings-dashboard-slot","component":"stockSettings"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"modals":[{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsModal"},{"name":"stock-operation-dialog","component":"stockOperationModal"}],"pages":[{"component":"root","route":"stock-management"}],"version":"1.0.1-pre.726"}
|
package/package.json
CHANGED
@@ -48,16 +48,16 @@ const AddStockOperation: React.FC<AddStockOperationProps> = (props) => {
|
|
48
48
|
|
49
49
|
const [requiresDispatchAcknowledgement, setRequiresDispatchAcknowledgement] = useState(false);
|
50
50
|
|
51
|
-
const currentStockOperationType = types?.results?.find((p) => p.operationType === props
|
51
|
+
const currentStockOperationType = types?.results?.find((p) => p.operationType === props?.model?.operationType);
|
52
52
|
|
53
53
|
useEffect(() => {
|
54
54
|
if (
|
55
55
|
currentStockOperationType?.operationType === OperationType.REQUISITION_OPERATION_TYPE ||
|
56
|
-
props
|
56
|
+
props?.model?.operationType === OperationType.REQUISITION_OPERATION_TYPE
|
57
57
|
) {
|
58
|
-
setRequisition(props
|
58
|
+
setRequisition(props?.model?.uuid);
|
59
59
|
}
|
60
|
-
}, [currentStockOperationType, props
|
60
|
+
}, [currentStockOperationType, props?.model?.operationType, props?.model?.uuid]);
|
61
61
|
|
62
62
|
useEffect(() => {
|
63
63
|
if (
|
@@ -110,8 +110,8 @@ const AddStockOperation: React.FC<AddStockOperationProps> = (props) => {
|
|
110
110
|
{...props}
|
111
111
|
isEditing={props?.operation?.name === 'Stock Issue' ? !isEditing : isEditing}
|
112
112
|
setup={result}
|
113
|
-
canEdit={
|
114
|
-
model={isEditing ? props?.model : props?.operation?.name === 'Stock Issue' ? props?.model : result?.dto}
|
113
|
+
canEdit={canEdit}
|
114
|
+
model={isEditing ? props?.model : props?.operation?.name === 'Stock Issue' ? props?.model : result?.dto}
|
115
115
|
onSave={async () => {
|
116
116
|
setManageStockItems(true);
|
117
117
|
setSelectedIndex(1);
|
@@ -291,7 +291,7 @@ const AddStockOperation: React.FC<AddStockOperationProps> = (props) => {
|
|
291
291
|
<h6 style={{ color: '#24a148' }}>Related Transactions:</h6>
|
292
292
|
{operationLinks.map(
|
293
293
|
(item) =>
|
294
|
-
(props
|
294
|
+
(props?.model?.uuid === item?.parentUuid || currentStockOperationType?.uuid === item?.parentUuid) && (
|
295
295
|
<>
|
296
296
|
<span>{item?.childOperationTypeName}</span>
|
297
297
|
<span className={item?.childVoided ? 'voided' : ''}>
|
@@ -91,8 +91,6 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
|
|
91
91
|
setIsSaving(false);
|
92
92
|
}
|
93
93
|
};
|
94
|
-
|
95
|
-
const isCompleteStatus = model?.status === 'COMPLETED';
|
96
94
|
const sourceTags =
|
97
95
|
operation?.stockOperationTypeLocationScopes
|
98
96
|
?.filter((p) => operation?.hasSource && p.isSource)
|
@@ -125,7 +123,7 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
|
|
125
123
|
return (
|
126
124
|
<div style={{ margin: '10px' }}>
|
127
125
|
<form className={`${styles.formContainer} ${styles.verticalForm}`}>
|
128
|
-
{
|
126
|
+
{!canEdit || operationType === 'stockissue' ? (
|
129
127
|
<>
|
130
128
|
{model?.operationDate && (
|
131
129
|
<TextInput
|
@@ -146,7 +144,7 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
|
|
146
144
|
{model?.atLocationName && (
|
147
145
|
<TextInput
|
148
146
|
id="sourceLbl"
|
149
|
-
value={model
|
147
|
+
value={operationType === 'stockissue' ? issueStockOperation.sourceName : model?.sourceName ?? ''}
|
150
148
|
readOnly={true}
|
151
149
|
labelText={t('source', 'Source')}
|
152
150
|
/>
|
@@ -154,7 +152,9 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
|
|
154
152
|
{model?.destinationName && (
|
155
153
|
<TextInput
|
156
154
|
id="destinationLbl"
|
157
|
-
value={
|
155
|
+
value={
|
156
|
+
operationType === 'stockissue' ? issueStockOperation.destinationName : model?.destinationName ?? ''
|
157
|
+
}
|
158
158
|
readOnly={true}
|
159
159
|
labelText={t('destination', 'Destination')}
|
160
160
|
/>
|
@@ -173,6 +173,20 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
|
|
173
173
|
{model?.remarks && (
|
174
174
|
<TextInput id="remarksLbl" value={model.remarks} readOnly={true} labelText={t('remarks', 'Remarks')} />
|
175
175
|
)}
|
176
|
+
{operationType === 'stockissue' && (
|
177
|
+
<div style={{ display: 'flex', flexDirection: 'row-reverse' }}>
|
178
|
+
<Button
|
179
|
+
name="save"
|
180
|
+
type="button"
|
181
|
+
className="submitButton"
|
182
|
+
onClick={handleSubmit(handleSave)}
|
183
|
+
kind="primary"
|
184
|
+
renderIcon={ArrowRight}
|
185
|
+
>
|
186
|
+
{isSaving ? <InlineLoading /> : t('next', 'Next')}
|
187
|
+
</Button>
|
188
|
+
</div>
|
189
|
+
)}
|
176
190
|
</>
|
177
191
|
) : (
|
178
192
|
<>
|
@@ -15,10 +15,11 @@ const StockOperationReference = (props: StockOperationReferenceProps) => {
|
|
15
15
|
const { types } = useStockOperationTypes();
|
16
16
|
|
17
17
|
let model: StockOperationDTO;
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
if (props?.operationUuid) {
|
19
|
+
getStockOperation(props?.operationUuid).then((resp) => {
|
20
|
+
model = resp?.data;
|
21
|
+
});
|
22
|
+
}
|
22
23
|
|
23
24
|
const handleEdit = () => {
|
24
25
|
const operation = types.results?.find((op) => op?.uuid === model?.operationTypeUuid);
|
@@ -49,7 +49,6 @@ const StockOperationSubmission: React.FC<StockOperationSubmissionProps> = ({
|
|
49
49
|
name="rbgApprovelRequired"
|
50
50
|
legendText={t('doesThisTransactionRequireApproval', 'Does the transaction require approval ?')}
|
51
51
|
onChange={handleRadioButtonChange}
|
52
|
-
defaultSelected={model?.approvalRequired === null ? false : approvalRequired}
|
53
52
|
>
|
54
53
|
<RadioButton value={true} id="rbgApprovelRequired-true" labelText={t('yes', 'Yes')} />
|
55
54
|
<RadioButton value={false} id="rbgApprovelRequired-false" labelText={t('no', 'No')} />
|
@@ -115,7 +114,6 @@ const StockOperationSubmission: React.FC<StockOperationSubmissionProps> = ({
|
|
115
114
|
}}
|
116
115
|
renderIcon={Departure}
|
117
116
|
>
|
118
|
-
{t('dispatch', 'Dispatch')}
|
119
117
|
{isSaving ? (
|
120
118
|
<InlineLoading description={t('dispatching', 'Dispatching')} />
|
121
119
|
) : (
|
@@ -30,6 +30,7 @@ export const addOrEditStockOperation = async (
|
|
30
30
|
delete payload.operationTypeUuid;
|
31
31
|
delete payload.permission;
|
32
32
|
delete payload.locked;
|
33
|
+
|
33
34
|
payload['operationTypeUuid'] = stockIssueOpsTypeUuid;
|
34
35
|
}
|
35
36
|
const response: FetchResponse<StockOperationDTO> = await (isEditing ? updateStockOperation : createStockOperation)(
|
@@ -8,7 +8,6 @@ export function useStockOperationPages(filter: StockOperationFilter) {
|
|
8
8
|
|
9
9
|
const pageSizes = [10, 20, 30, 40, 50];
|
10
10
|
const [currentPageSize, setPageSize] = useState(10);
|
11
|
-
console.log(items.results);
|
12
11
|
|
13
12
|
const { goTo, results: paginatedItems, currentPage } = usePagination(items.results, currentPageSize);
|
14
13
|
|
@@ -58,18 +58,23 @@ export function getStockOperationLinks(filter: string) {
|
|
58
58
|
}
|
59
59
|
|
60
60
|
// getStockOperation
|
61
|
-
|
62
|
-
|
63
|
-
const
|
61
|
+
|
62
|
+
export function useStockOperation(id: string | null) {
|
63
|
+
const apiUrl = id ? `${restBaseUrl}/stockmanagement/stockoperation/${id}` : null;
|
64
|
+
const { data, error, isLoading } = useSWR<{ data: StockOperationDTO }, Error>(apiUrl, apiUrl ? openmrsFetch : null);
|
64
65
|
return {
|
65
|
-
items: data
|
66
|
+
items: data?.data || {},
|
66
67
|
isLoading,
|
67
68
|
error,
|
68
69
|
};
|
69
|
-
}
|
70
|
+
}
|
71
|
+
|
72
|
+
// getStockOperation
|
70
73
|
export function getStockOperation(id: string): Promise<FetchResponse<StockOperationDTO>> {
|
74
|
+
if (!id) {
|
75
|
+
return;
|
76
|
+
}
|
71
77
|
const apiUrl = `${restBaseUrl}/stockmanagement/stockoperation/${id}?v=full`;
|
72
|
-
|
73
78
|
return openmrsFetch(apiUrl);
|
74
79
|
}
|
75
80
|
|
@@ -100,6 +100,11 @@ const StockReports: React.FC = () => {
|
|
100
100
|
header: t('status', 'Status'),
|
101
101
|
key: 'status',
|
102
102
|
},
|
103
|
+
{
|
104
|
+
id: 5,
|
105
|
+
header: t('timeTaken', 'Time Taken'),
|
106
|
+
key: 'timeTaken',
|
107
|
+
},
|
103
108
|
{
|
104
109
|
id: 8,
|
105
110
|
header: t('actions', 'Actions'),
|
@@ -131,9 +136,13 @@ const StockReports: React.FC = () => {
|
|
131
136
|
)),
|
132
137
|
status: (
|
133
138
|
<>
|
134
|
-
{batchJob.status === BatchJobStatusPending
|
135
|
-
<InlineLoading
|
136
|
-
|
139
|
+
{batchJob.status === BatchJobStatusPending ? (
|
140
|
+
<InlineLoading
|
141
|
+
status={batchJob.status === BatchJobStatusPending ? 'active' : 'inactive'}
|
142
|
+
iconDescription="Loading"
|
143
|
+
description={batchJob.status === BatchJobStatusPending ? 'Generating report...' : ''}
|
144
|
+
/>
|
145
|
+
) : null}
|
137
146
|
{batchJob.status === BatchJobStatusFailed && (
|
138
147
|
<WarningAltFilled className="report-failed" title={batchJob.status} />
|
139
148
|
)}
|
@@ -148,6 +157,7 @@ const StockReports: React.FC = () => {
|
|
148
157
|
)}
|
149
158
|
</>
|
150
159
|
),
|
160
|
+
timeTaken: formatDuration(batchJob.dateCreated, batchJob.endTime),
|
151
161
|
actions: (
|
152
162
|
<div key={`${batchJob?.uuid}-actions`} style={{ display: 'inline-block', whiteSpace: 'nowrap' }}>
|
153
163
|
{batchJob.outputArtifactViewable && batchJob.batchJobType === 'hide' && (
|
@@ -301,4 +311,19 @@ const StockReports: React.FC = () => {
|
|
301
311
|
);
|
302
312
|
};
|
303
313
|
|
314
|
+
const formatDuration = (start: string, end: string) => {
|
315
|
+
const startDate = new Date(start).getTime();
|
316
|
+
const endDate = new Date(end).getTime();
|
317
|
+
|
318
|
+
if (!startDate || !endDate) return '';
|
319
|
+
|
320
|
+
const durationInMillis = endDate - startDate;
|
321
|
+
const totalSeconds = Math.floor(durationInMillis / 1000);
|
322
|
+
const hours = Math.floor(totalSeconds / 3600);
|
323
|
+
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
324
|
+
const seconds = totalSeconds % 60;
|
325
|
+
|
326
|
+
return [hours, minutes, seconds].map((unit) => String(unit).padStart(2, '0')).join(':');
|
327
|
+
};
|
328
|
+
|
304
329
|
export default StockReports;
|
@@ -14,11 +14,16 @@ export function useReportTypes() {
|
|
14
14
|
}
|
15
15
|
export function useGetReports() {
|
16
16
|
const apiUrl = `${restBaseUrl}/stockmanagement/batchjob?batchJobType=Report&v=default&limit=10&totalCount=true`;
|
17
|
-
|
17
|
+
|
18
|
+
const { data, error, isLoading, mutate } = useSWR<{ data: { results: any } }, Error>(apiUrl, openmrsFetch, {
|
19
|
+
refreshInterval: 1000,
|
20
|
+
dedupingInterval: 1000,
|
21
|
+
});
|
22
|
+
|
18
23
|
const pageSizes = [10, 20, 30, 40, 50];
|
19
24
|
const [currentPageSize, setPageSize] = useState(10);
|
20
|
-
|
21
25
|
const { goTo, results: paginatedItems, currentPage } = usePagination(data?.data?.results, currentPageSize);
|
26
|
+
|
22
27
|
return {
|
23
28
|
reports: data?.data?.results ?? [],
|
24
29
|
isLoading,
|
@@ -31,5 +36,6 @@ export function useGetReports() {
|
|
31
36
|
goTo,
|
32
37
|
pageSizes,
|
33
38
|
setPageSize,
|
39
|
+
mutate,
|
34
40
|
};
|
35
41
|
}
|