fix: update tracked domain table

This commit is contained in:
Maël Gangloff
2025-01-04 01:19:40 +01:00
parent 7db1c9c2eb
commit 2afc2e9577
2 changed files with 2 additions and 4 deletions

View File

@@ -62,7 +62,7 @@ export function TrackedDomainTable() {
const notices: ReactElement[] = []
setDataTable(data['hydra:member'].map((d: Domain) => {
const expirationDate = d.events.find(e => e.action === 'expiration' && !e.deleted)?.date
const expiresInDays = d.expiresInDays ? -d.expiresInDays : undefined
const expiresInDays = d.expiresInDays && d.expiresInDays > 0 ? -d.expiresInDays : undefined
if (d.status.includes('redemption period')) {
if (!notices.includes(REDEMPTION_NOTICE)) notices.push(REDEMPTION_NOTICE)

View File

@@ -121,9 +121,6 @@ class Domain
#[Groups(['domain:item', 'domain:list'])]
private ?bool $delegationSigned = null;
#[Groups(['domain:item', 'domain:list'])]
protected ?int $expiresInDays = null;
private const IMPORTANT_EVENTS = [EventAction::Deletion->value, EventAction::Expiration->value];
private const IMPORTANT_STATUS = [
'redemption period',
@@ -468,6 +465,7 @@ class Domain
/**
* @throws \Exception
*/
#[Groups(['domain:item', 'domain:list'])]
public function getExpiresInDays(): ?int
{
$now = new \DateTimeImmutable();