started messages migration to ts

This commit is contained in:
canove
2020-09-19 22:49:27 -03:00
parent 70c391e8ef
commit 9368ef2512
10 changed files with 295 additions and 230 deletions

View File

@@ -9,7 +9,7 @@ import UpdateUserService from "../services/UserServices/UpdateUserService";
import FindUserService from "../services/UserServices/FindUserService";
import DeleteUserService from "../services/UserServices/DeleteUserService";
type RequestQuery = {
type IndexQuery = {
searchParam: string;
pageNumber: string;
};
@@ -18,7 +18,7 @@ export const index = async (req: Request, res: Response): Promise<Response> => {
if (req.user.profile !== "admin") {
throw new AppError("Only administrators can access this route.", 403); // should be handled better.
}
const { searchParam, pageNumber } = req.query as RequestQuery;
const { searchParam, pageNumber } = req.query as IndexQuery;
const { users, count, hasMore } = await ListUsersService({
searchParam,