Renamed script

pull/73/head
MillenniumEarl 2021-02-21 14:57:29 +01:00
parent 7770b95322
commit 598eb81c2a
1 changed files with 7 additions and 7 deletions

View File

@ -8,7 +8,7 @@ import PrefixParser from './prefix-parser.js';
/** /**
* Query used to search for specific threads on the platform. * Query used to search for specific threads on the platform.
*/ */
export default class SearchQuery { export default class HandiworkSearchQuery {
//#region Private fields //#region Private fields
private static MAX_TAGS = 5; private static MAX_TAGS = 5;
@ -24,7 +24,7 @@ export default class SearchQuery {
* `games`, `comics`, `animations`, `assets`. * `games`, `comics`, `animations`, `assets`.
* Default: `games` * Default: `games`
*/ */
@validator.IsIn(SearchQuery.VALID_CATEGORY, { @validator.IsIn(HandiworkSearchQuery.VALID_CATEGORY, {
message: "Invalid $property parameter: $value" message: "Invalid $property parameter: $value"
}) })
public category = 'games'; public category = 'games';
@ -35,7 +35,7 @@ export default class SearchQuery {
@validator.IsArray({ @validator.IsArray({
message: "Expected an array, received $value" message: "Expected an array, received $value"
}) })
@validator.ArrayMaxSize(SearchQuery.MAX_TAGS, { @validator.ArrayMaxSize(HandiworkSearchQuery.MAX_TAGS, {
message: "Too many tags: $value instead of $constraint1" message: "Too many tags: $value instead of $constraint1"
}) })
public tags: string[] = []; public tags: string[] = [];
@ -50,7 +50,7 @@ export default class SearchQuery {
* Sorting type between (default: `date`): * Sorting type between (default: `date`):
* `date`, `likes`, `views`, `title`, `rating` * `date`, `likes`, `views`, `title`, `rating`
*/ */
@validator.IsIn(SearchQuery.VALID_SORT, { @validator.IsIn(HandiworkSearchQuery.VALID_SORT, {
message: "Invalid $property parameter: $value" message: "Invalid $property parameter: $value"
}) })
public sort = 'date'; public sort = 'date';
@ -61,7 +61,7 @@ export default class SearchQuery {
* Use `1` to indicate "today" or `null` to indicate "anytime". * Use `1` to indicate "today" or `null` to indicate "anytime".
* Default: `null` * Default: `null`
*/ */
@validator.IsIn(SearchQuery.VALID_DATE, { @validator.IsIn(HandiworkSearchQuery.VALID_DATE, {
message: "Invalid $property parameter: $value" message: "Invalid $property parameter: $value"
}) })
public date: number = null; public date: number = null;
@ -73,10 +73,10 @@ export default class SearchQuery {
@validator.IsInt({ @validator.IsInt({
message: "$property expect an integer, received $value" message: "$property expect an integer, received $value"
}) })
@validator.Min(SearchQuery.MIN_PAGE, { @validator.Min(HandiworkSearchQuery.MIN_PAGE, {
message: "The minimum $property value must be $constraint1, received $value" message: "The minimum $property value must be $constraint1, received $value"
}) })
public page = SearchQuery.MIN_PAGE; public page = HandiworkSearchQuery.MIN_PAGE;
//#endregion Properties //#endregion Properties
//#region Public methods //#region Public methods