Skip to content

Commit

Permalink
Check directly against meta field name as we only have one
Browse files Browse the repository at this point in the history
This just makes it all clearer. If/when we add more meta fields, that's something we can revisit then.
  • Loading branch information
caendesilva committed Apr 24, 2023
1 parent 59bceee commit 7f4718c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/publications/src/Models/PublicationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use function is_null;
use function json_decode;
use function json_encode;
use function str_starts_with;

/**
* @see \Hyde\Publications\Testing\Feature\PublicationTypeTest
Expand Down Expand Up @@ -183,7 +182,7 @@ public function getFieldDefinition(string $fieldName): PublicationFieldDefinitio

public function getCanonicalFieldDefinition(): PublicationFieldDefinition
{
if (str_starts_with($this->canonicalField, '__')) { // Todo check directly against __createdAt
if ($this->canonicalField === '__createdAt') {
return new PublicationFieldDefinition('string', $this->canonicalField);
}

Expand Down

0 comments on commit 7f4718c

Please sign in to comment.