mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-22 15:13:59 -06:00
Replaced colon by hyphen as the ordering field-dir separator as it's a valid URL character
This commit is contained in:
parent
25fbbee883
commit
be71a6eeb4
@ -31,7 +31,7 @@
|
||||
{
|
||||
"name": "tags[]",
|
||||
"in": "query",
|
||||
"description": "A list of tags used to filter the resultset. Only short URLs tagged with at least one of the provided tags will be returned. (Since v1.3.0)",
|
||||
"description": "A list of tags used to filter the result set. Only short URLs tagged with at least one of the provided tags will be returned. (Since v1.3.0)",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "array",
|
||||
@ -48,10 +48,14 @@
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"longUrl",
|
||||
"shortCode",
|
||||
"dateCreated",
|
||||
"visits"
|
||||
"longUrl-ASC",
|
||||
"longUrl-DESC",
|
||||
"shortCode-ASC",
|
||||
"shortCode-DESC",
|
||||
"dateCreated-ASC",
|
||||
"dateCreated-DESC",
|
||||
"visits-ASC",
|
||||
"visits-DESC"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -50,7 +50,7 @@ final class ShortUrlsOrdering
|
||||
}
|
||||
|
||||
if (! $isArray) {
|
||||
$parts = explode(':', $orderBy);
|
||||
$parts = explode('-', $orderBy);
|
||||
$this->orderField = $parts[0];
|
||||
$this->orderDirection = $parts[1] ?? self::DEFAULT_ORDER_DIRECTION;
|
||||
} else {
|
||||
|
@ -137,7 +137,7 @@ class ListShortUrlsTest extends ApiTestCase
|
||||
self::SHORT_URL_DOCS,
|
||||
self::SHORT_URL_CUSTOM_DOMAIN,
|
||||
]];
|
||||
yield [['orderBy' => ['shortCode' => 'DESC']], [
|
||||
yield [['orderBy' => ['shortCode' => 'DESC']], [ // Deprecated
|
||||
self::SHORT_URL_DOCS,
|
||||
self::SHORT_URL_CUSTOM_DOMAIN,
|
||||
self::SHORT_URL_META,
|
||||
@ -145,7 +145,7 @@ class ListShortUrlsTest extends ApiTestCase
|
||||
self::SHORT_URL_CUSTOM_SLUG,
|
||||
self::SHORT_URL_SHLINK,
|
||||
]];
|
||||
yield [['orderBy' => 'shortCode:DESC'], [
|
||||
yield [['orderBy' => 'shortCode-DESC'], [
|
||||
self::SHORT_URL_DOCS,
|
||||
self::SHORT_URL_CUSTOM_DOMAIN,
|
||||
self::SHORT_URL_META,
|
||||
|
Loading…
Reference in New Issue
Block a user