fetches and displays measurement units
This commit is contained in:
@@ -3,7 +3,7 @@ import pool from "../db";
|
||||
export default class Dropdown {
|
||||
async getMeasurements() {
|
||||
try {
|
||||
const statement = `SELECT * FROM recipin.dropdownVals WHERE datatype = MEASUREMENTS`;
|
||||
const statement = `SELECT * FROM recipin.dropdownVals WHERE datatype = 'MEASUREMENTS'`;
|
||||
const result = await pool.query(statement);
|
||||
if (result.rows.length) return result.rows;
|
||||
return null;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { DropdownDataType } from '../schemas';
|
||||
const router = Router();
|
||||
const DDInstance = new DropdownCtl();
|
||||
|
||||
export const dropdownValue = (app: Express) => {
|
||||
export const dropdownValueRouter = (app: Express) => {
|
||||
app.use('/app/dropdown', router);
|
||||
|
||||
router.get('/', async (req, res, next) => {
|
||||
@@ -24,4 +24,5 @@ export const dropdownValue = (app: Express) => {
|
||||
}
|
||||
})
|
||||
|
||||
return router;
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import { subscriptionRoute } from "./subscription";
|
||||
import { friendRouter } from "./friend";
|
||||
import { cuisineRouter } from "./cuisine";
|
||||
import { courseRouter } from "./course";
|
||||
import { dropdownValueRouter } from "./dropdownValues";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
@@ -47,6 +48,7 @@ export const routes = async (app: Express) => {
|
||||
subscriptionRoute(app);
|
||||
groceryListRoute(app);
|
||||
courseRouter(app);
|
||||
dropdownValueRouter(app);
|
||||
|
||||
// deprecate?
|
||||
cuisineRouter(app);
|
||||
|
||||
Reference in New Issue
Block a user