Hide "Expiry Date" column if feature not enabled (#8172)

This commit is contained in:
Oliver authored and GitHub committed 2024-09-26 11:03:37 +10:00
1 parent 752b33177b
commit 1522d1e615
1 file changed
+3 -1
@@ -25,6 +25,7 @@ import { notYetImplemented } from '../../functions/notifications';
import { useCreateApiFormModal } from '../../hooks/UseForm';
import { useTable } from '../../hooks/UseTable';
import { apiUrl } from '../../states/ApiState';
import { useGlobalSettingsState } from '../../states/SettingsState';
import { useUserState } from '../../states/UserState';
import { TableColumn } from '../Column';
import {
@@ -234,7 +235,8 @@ function stockItemTableColumns(): TableColumn[] {
}),
DateColumn({
title: t`Expiry Date`,
accessor: 'expiry_date'
accessor: 'expiry_date',
hidden: !useGlobalSettingsState.getState().isSet('STOCK_ENABLE_EXPIRY')
}),
DateColumn({
title: t`Last Updated`,