mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-11 23:58:46 +08:00
Refactor the backend
This commit is contained in:
@@ -3,7 +3,6 @@ import { injectable, inject } from "inversify";
|
||||
import { TYPES } from "../core/types";
|
||||
import { Searcher } from "../services/Searcher";
|
||||
import { BaseController } from "./BaseController";
|
||||
import { sendSuccess } from "../utils/response";
|
||||
|
||||
@injectable()
|
||||
export class ResourceController extends BaseController {
|
||||
@@ -14,12 +13,11 @@ export class ResourceController extends BaseController {
|
||||
async search(req: Request, res: Response): Promise<void> {
|
||||
await this.handleRequest(req, res, async () => {
|
||||
const { keyword, channelId = "", lastMessageId = "" } = req.query;
|
||||
const result = await this.searcher.searchAll(
|
||||
return await this.searcher.searchAll(
|
||||
keyword as string,
|
||||
channelId as string,
|
||||
lastMessageId as string
|
||||
);
|
||||
sendSuccess(res, result);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user