Skip to content

Commit

Permalink
fix(T246): inibizione aggiunta cittadini per servizi con data futura …
Browse files Browse the repository at this point in the history
…20241111
  • Loading branch information
federico-tocci-dxc committed Nov 11, 2024
1 parent 35e4df9 commit cd3f608
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const CitizenListTableHeading: TableHeadingI[] = [
},
];

const CitizensList: React.FC = () => {
const CitizensList: React.FC<{ dataServizio: Date }> = ({ dataServizio }) => {
const { serviceId } = useParams();
const dispatch = useDispatch();
const navigate = useNavigate();
Expand Down Expand Up @@ -245,6 +245,7 @@ const CitizensList: React.FC = () => {
{
text: 'Aggiungi cittadino',
color: 'primary',
disabled: moment().isBefore(moment(dataServizio)),
onClick: () => {
dispatch(openModal({ id: 'search-citizen-modal' }));
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ const ServicesDetails = () => {
break;
case tabs.CITIZENS:
setActiveTab(tabs.CITIZENS);
setContent(<CitizensList />);
const serviceDate = new Date(serviceDetails.dettaglioServizio.dataServizio);
setContent(<CitizensList dataServizio={serviceDate} />);
break;
default:
setActiveTab(tabs.INFO);
Expand Down

0 comments on commit cd3f608

Please sign in to comment.