Commit | Line | Data |
---|---|---|
625022fd BA |
1 | // Get variants list (always needed) |
2 | ||
3 | let router = require("express").Router(); | |
4 | const createError = require('http-errors'); | |
5 | const VariantModel = require("../models/Variant"); | |
6 | const access = require("../utils/access"); | |
7 | ||
8 | router.get('/variants', access.ajax, function(req, res, next) { | |
dac39588 BA |
9 | VariantModel.getAll((err,variants) => { |
10 | if (!!err) | |
11 | return next(err); | |
12 | res.json({variantArray:variants}); | |
13 | }); | |
625022fd BA |
14 | }); |
15 | ||
16 | module.exports = router; |