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:
1 parent
7b0b29e6c6
commit
3f6d2cc3a8
8 files changed
+832
-140
No files matched your search
+22
-14
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user