All files / postcardotp-backend/src/controllers adminController.js

50% Statements 8/16
100% Branches 0/0
0% Functions 0/2
50% Lines 8/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 281x 1x 1x 1x 1x   1x   1x                   1x                  
const successResponse = require("../utils/successResponse");
const adminService = require("../services/adminService");
const { ApiError } = require("../utils/errorHandler");
const { models } = require("../config/sequelize");
const logger = require("../utils/logger");
 
require("dotenv").config();
 
exports.getStats = async (req, res, next) => {
  try {
    const users = await adminService.getUsers(req.userId);
 
    successResponse(res, users, "Users retrieved successfully", 200);
  } catch (error) {
    next(error);
  }
};
 
exports.getCustomers = async (req, res, next) => {
  try {
    const customers = await adminService.getCustomers();
 
    successResponse(res, customers, "customers retrieved successfully", 200);
  } catch (error) {
    next(error);
  }
};