style: riviste parti dell'interfaccia dei ticket. feat: aggiunta possiblità di modificare il tempo inserito nelle note ed aggiunta voce per tempo nel menu azioni rapide

This commit is contained in:
2026-07-07 21:14:24 +02:00
parent 7b0b29e6c6
commit 3f6d2cc3a8
8 changed files with 832 additions and 140 deletions
+22 -14
View File
@@ -168,22 +168,30 @@ router.get('/lock-types', async (req, res) => {
// GET /api/customer-companies/search — Search customer companies
router.get('/customer-companies/search', async (req, res) => {
try {
const { q } = req.query;
const { q = '' } = req.query;
let result;
if (!q) {
return res.json([]);
result = await pool.query(
`SELECT customer_id, name
FROM customer_company
WHERE valid_id = 1
ORDER BY name
LIMIT 20`
);
} else {
const searchTerm = `%${q}%`;
result = await pool.query(
`SELECT customer_id, name
FROM customer_company
WHERE valid_id = 1 AND (
customer_id ILIKE $1 OR
name ILIKE $1
)
ORDER BY name
LIMIT 20`,
[searchTerm]
);
}
const searchTerm = `%${q}%`;
const result = await pool.query(
`SELECT customer_id, name
FROM customer_company
WHERE valid_id = 1 AND (
customer_id ILIKE $1 OR
name ILIKE $1
)
ORDER BY name
LIMIT 20`,
[searchTerm]
);
res.json(result.rows);
} catch (err) {
console.error('Error searching customer companies:', err);