forked from apxtri/apxtrib
20 lines
892 B
JavaScript
20 lines
892 B
JavaScript
|
const express = require( 'express' );
|
||
|
const glob = require( 'glob' );
|
||
|
const path = require( 'path' );
|
||
|
// Classes
|
||
|
const Odmdb = require( '../models/Odmdb.js' );
|
||
|
// Middlewares
|
||
|
const checkHeaders = require( '../middlewares/checkHeaders' );
|
||
|
const isAuthenticated = require( '../middlewares/isAuthenticated' );
|
||
|
const hasAccessrighton = require( '../middlewares/hasAccessrighton' );
|
||
|
const router = express.Router();
|
||
|
|
||
|
router.get('/searchauth/:objectname/:question',checkHeaders,isAuthenticated,( req, res ) => {
|
||
|
console.log( 'route referentials get all language' + req.params.objectname + '-' + req.params.question );
|
||
|
const getref = Referentials.getref( true, req.params.source, req.params.idref, req.session.header.xworkon, req.session.header.xlang );
|
||
|
// Return any status the data if any erreur return empty object
|
||
|
res.jsonp( getref.payload.data );
|
||
|
} );
|
||
|
|
||
|
module.exports = router;
|