Added relations to redis ORM

This commit is contained in:
2024-08-13 15:18:47 -04:00
parent 2a5ca3664a
commit b27e1b1617
20 changed files with 240 additions and 150 deletions
+2 -2
View File
@@ -1,14 +1,14 @@
'use strict';
const router = require('express').Router();
const {Host} = require('../models/host');
const {Host, Domain} = require('../models').models;
const Model = Host;
router.get('/', async function(req, res, next){
try{
return res.json({
hosts: await Model[req.query.detail ? "listDetail" : "list"]()
results: await Model[req.query.detail ? "listDetail" : "list"](),
});
}catch(error){
return next(error);