const express = require("express");
const router = express.Router();

const upload = require("../middleware/upload.middleware");
const { requireLogin } = require("../middleware/auth.middleware");
const { uploadPatientFile } = require("../controllers/patientFile.controller");

router.post(
  "/patients/:id/files",
  requireLogin,
  (req, res, next) => {
    console.log("📥 UPLOAD ROUTE GETROFFEN");
    next();
  },
  upload.single("file"),
  uploadPatientFile
);

module.exports = router;
