import express from 'express';
import { getIorInfo } from '../libs/globalData.js';

const router = express.Router();

router.get('/get_ior_info/:id/:ior', (req, res) => {
  const { id, ior } = req.params ?? {};
  getIorInfo(ior, id)
  .then(iorInfo => {
    res.sendSuccess(iorInfo);
  })
  .catch(err => {
    res.sendError(err);
  });
});

export default router;
