feat: Add pedigree routes for COI calculation, direct relation checks, and ancestral/descendant trees.
This commit is contained in:
@@ -124,8 +124,7 @@ function calculateCOI(db, sireId, damId) {
|
||||
// 'trial-pairing' as dog IDs and return 404/wrong data.
|
||||
// =====================================================================
|
||||
|
||||
// POST /api/pedigree/trial-pairing (alias for /coi)
|
||||
router.post(['/trial-pairing', '/coi'], (req, res) => {
|
||||
const handleTrialPairing = (req, res) => {
|
||||
try {
|
||||
const { sire_id, dam_id } = req.body;
|
||||
if (!sire_id || !dam_id) {
|
||||
@@ -156,7 +155,13 @@ router.post(['/trial-pairing', '/coi'], (req, res) => {
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// POST /api/pedigree/trial-pairing
|
||||
router.post('/trial-pairing', handleTrialPairing);
|
||||
|
||||
// POST /api/pedigree/coi
|
||||
router.post('/coi', handleTrialPairing);
|
||||
|
||||
// GET /api/pedigree/:id/coi
|
||||
router.get('/:id/coi', (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user