Skip to content

Commit da6ecda

Browse files
committed
- App\PostsQuery\ParamsValidator::validate40001() as now allow querying from multiple forum by omitting the fid param that already removed from unique params since 4e567d9
* remove error code `40001` @ `App\Helper::ERROR_STATUS_CODE_INFO` @ be
1 parent 3db4299 commit da6ecda

2 files changed

Lines changed: 0 additions & 8 deletions

File tree

be/src/Helper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public static function abortAPIIfNot(int $errorCode, bool $condition): void
6060
// httpStatusCode => [ errorCode => errorInfo ]
6161
400 => [
6262
// 40000 => App\Exceptions\Handler::convertValidationExceptionToResponse()
63-
40001 => '帖子查询类型必须为索引或搜索查询',
6463
40003 => '部分查询参数与查询帖子类型要求不匹配',
6564
40004 => '排序方式与查询帖子类型要求不匹配',
6665
40005 => '提供了多个唯一查询参数',

be/src/PostsQuery/ParamsValidator.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public function setParams(array $value): static
2626
{
2727
array_map($this->validateParamValue(...), $value);
2828
$this->params = new QueryParams($value);
29-
$this->validate40001();
3029
$this->validate40005();
3130
return $this;
3231
}
@@ -88,12 +87,6 @@ private function validateParamValue(array $param): void
8887
], allowMissingFields: true));
8988
}
9089

91-
private function validate40001(): void
92-
{
93-
// only fill postTypes and/or orderBy uniqueParam doesn't query anything
94-
Helper::abortAPIIf(40001, $this->params->count() === \count($this->params->pick('postTypes', 'orderBy')));
95-
}
96-
9790
private function validate40005(): void
9891
{
9992
foreach (self::UNIQUE_PARAMS_NAME as $uniqueParamName) { // is all unique param only appeared once

0 commit comments

Comments
 (0)