import { FastifyInstanceType } from "../../utils/types";
import { deleteFile } from "./controller";
import { minioDeleteFileSchema } from "./schema";

export async function adminMinioRoutes(fastify: FastifyInstanceType) {
  //-------------------------------------------------------------------------------
  fastify.post(
    "",
    {
      preHandler: (req, reply) => fastify.adminAuth(req, reply, undefined),
      schema: {
        body: minioDeleteFileSchema,
      },
    },
    deleteFile
  );
  //-------------------------------------------------------------------------------
  fastify.log.info("minio routes registered");
}
