Long URLs can now be edited on existing short URLs

This commit is contained in:
Alejandro Celaya
2020-03-22 14:04:01 +01:00
parent 59c0d36c0b
commit 4e6836c605
8 changed files with 134 additions and 28 deletions

View File

@@ -23,6 +23,7 @@ class ShortUrlMetaInputFilter extends InputFilter
public const FIND_IF_EXISTS = 'findIfExists';
public const DOMAIN = 'domain';
public const SHORT_CODE_LENGTH = 'shortCodeLength';
public const LONG_URL = 'longUrl';
public function __construct(array $data)
{
@@ -32,6 +33,8 @@ class ShortUrlMetaInputFilter extends InputFilter
private function initialize(): void
{
$this->add($this->createInput(self::LONG_URL, false));
$validSince = $this->createInput(self::VALID_SINCE, false);
$validSince->getValidatorChain()->attach(new Validator\Date(['format' => DateTime::ATOM]));
$this->add($validSince);