feat: enhance AddAnnuncio options to include title in label and update query to select title in getAnnunciAvailableToAdd

This commit is contained in:
Marco Pedone 2026-03-09 10:41:34 +01:00
parent 43d67dceb8
commit 0904bba970
2 changed files with 2 additions and 2 deletions

View file

@ -555,7 +555,7 @@ const AddAnnuncio = ({
}} }}
options={ options={
codici?.map((cod) => ({ codici?.map((cod) => ({
label: cod.codice, label: `${cod.codice} - ${cod.titolo_it}`,
value: cod.id.toString(), value: cod.id.toString(),
})) || [] })) || []
} }

View file

@ -661,7 +661,7 @@ export const getAnnunciAvailableToAdd = async (
const ids = servizioAnnunci.map((item) => item.annunci_id); const ids = servizioAnnunci.map((item) => item.annunci_id);
let qry = tx let qry = tx
.selectFrom("annunci") .selectFrom("annunci")
.select(["id", "codice"]) .select(["id", "codice", "titolo_it"])
.where("annunci.web", "=", true) .where("annunci.web", "=", true)
.where("stato", "!=", "Sospeso"); .where("stato", "!=", "Sospeso");