Replace error throw with console error and return null for missing announcement by code
This commit is contained in:
parent
43f3c99185
commit
7a1f4ade54
1 changed files with 2 additions and 4 deletions
|
|
@ -75,10 +75,8 @@ export const getAnnunciByCod = async ({
|
|||
.where("codice", "=", cod)
|
||||
.executeTakeFirst();
|
||||
if (!annuncio) {
|
||||
throw new TRPCError({
|
||||
code: "NOT_FOUND",
|
||||
message: "Annuncio non trovato",
|
||||
});
|
||||
console.error("Annuncio non trovato per codice:", cod);
|
||||
return null;
|
||||
}
|
||||
|
||||
return AnnuncioObjectWithImages<typeof annuncio>(annuncio);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue