All files / server/src/features/program-item programItemController.ts

100% Statements 7/7
100% Branches 0/0
100% Functions 2/2
100% Lines 7/7

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              39x       8x 8x     39x       434x 434x 434x    
import { Request, Response } from "express";
import { getAuthorizedUserGroup } from "server/utils/authHeader";
import {
  fetchProgramItems,
  updateProgramItems,
} from "server/features/program-item/programItemService";
 
export const postUpdateProgramItems = async (
  _req: Request,
  res: Response,
): Promise<Response> => {
  const response = await updateProgramItems();
  return res.json(response);
};
 
export const getProgramItems = async (
  req: Request,
  res: Response,
): Promise<Response> => {
  const userGroup = getAuthorizedUserGroup(req.headers.authorization);
  const response = await fetchProgramItems(userGroup);
  return res.json(response);
};