13 lines
343 B
JavaScript
13 lines
343 B
JavaScript
import pool from '../db/index.js';
|
|
|
|
export async function getServiceOptions(req, res) {
|
|
try {
|
|
const { rows } = await pool.query(
|
|
'SELECT id, code, label, price_chf, price_type FROM service_options WHERE active = true ORDER BY id'
|
|
);
|
|
res.json(rows);
|
|
} catch (err) {
|
|
res.status(500).json({ error: err.message });
|
|
}
|
|
}
|