import { NextFunction, Request, Response } from "express";
import { CatchAsyncError } from "../../middleware/Catch";
import cacheService from "./users.service";
import { ApiResponse } from "../../middleware/ApiResponse";
import { ApiError } from "../../middleware/ApiError";



export const getAllUsers = CatchAsyncError(async (req: Request, res: Response, next: NextFunction) => {
    const response = await cacheService.getAllUserService();
    return res.status(200).json(response)
})

export const deleteUser = CatchAsyncError(async (req: Request, res: Response, next: NextFunction) => {

    const id = req.params.userId as string
    const response = await cacheService.deleteUserService(id);


    return res.status(200).json(response)
})

