diff --git a/src/scripts/classes/query/handiwork-search-query.ts b/src/scripts/classes/query/handiwork-search-query.ts index 5b4e59f..89fa43d 100644 --- a/src/scripts/classes/query/handiwork-search-query.ts +++ b/src/scripts/classes/query/handiwork-search-query.ts @@ -31,8 +31,7 @@ import ThreadSearchQuery, { TThreadOrder } from './thread-search-query.js'; * `views`: Order based on the number of visits. Replacement: `replies`. */ type THandiworkOrder = "date" | "likes" | "relevance" | "replies" | "title" | "views"; -type TLatestResult = Result; -type TThreadResult = Result>; +type TExecuteResult = Result>; export default class HandiworkSearchQuery implements IQuery { @@ -100,9 +99,9 @@ export default class HandiworkSearchQuery implements IQuery { public validate(): boolean { return validator.validateSync(this).length === 0; } - public async execute(): Promise { + public async execute(): Promise { // Local variables - let response: TLatestResult | TThreadResult = null; + let response: TExecuteResult = null; // Check if the query is valid if (!this.validate()) { @@ -173,6 +172,6 @@ export default class HandiworkSearchQuery implements IQuery { return query; } - + //#endregion } \ No newline at end of file diff --git a/src/scripts/classes/query/latest-search-query.ts b/src/scripts/classes/query/latest-search-query.ts index 17904f2..c5788ae 100644 --- a/src/scripts/classes/query/latest-search-query.ts +++ b/src/scripts/classes/query/latest-search-query.ts @@ -7,7 +7,7 @@ import validator from 'class-validator'; import { urls } from "../../constants/url.js"; import PrefixParser from '../prefix-parser.js'; import { IQuery, TCategory, TQueryInterface } from "../../interfaces.js"; -import { fetchHTML } from '../../network-helper.js'; +import { fetchGETResponse } from '../../network-helper.js'; // Type definitions export type TLatestOrder = "date" | "likes" | "views" | "title" | "rating"; @@ -74,7 +74,7 @@ export default class LatestSearchQuery implements IQuery { const decoded = decodeURIComponent(url.toString()); // Fetch the result - return await fetchHTML(decoded); + return await fetchGETResponse(decoded); } public findNearestDate(d: Date): TDate {