From 8cda756f6d3fcc59c00646e53b868fb93d401259 Mon Sep 17 00:00:00 2001 From: Nemo D'ACREMONT Date: Tue, 3 Dec 2024 11:05:48 +0100 Subject: [PATCH] fix: fix psql function --- PostgreSQL/src/functions.sql | 7 ++++++- back-end/src/app.ts | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/PostgreSQL/src/functions.sql b/PostgreSQL/src/functions.sql index 48d67f0..b000f65 100644 --- a/PostgreSQL/src/functions.sql +++ b/PostgreSQL/src/functions.sql @@ -16,7 +16,12 @@ LANGUAGE SQL; -- Liste des modèles faisables à partir d'un membre -CREATE OR REPLACE FUNCTION modeles_faisables_membre(int) RETURNS TABLE(id_modele int) AS +CREATE OR REPLACE FUNCTION modeles_faisables_membre(int) RETURNS TABLE( + id_modele int , + nom_modele VARCHAR(255) , + url_notice_modele VARCHAR(2048) , + id_membre int , id_modele_etendu int +) AS $$ SELECT * FROM modeles diff --git a/back-end/src/app.ts b/back-end/src/app.ts index edd06a4..d9318d0 100644 --- a/back-end/src/app.ts +++ b/back-end/src/app.ts @@ -29,6 +29,10 @@ app.use(morgan(log_format)); // Defines endpoints app.use(routes); +process.on('*', (e) => { + console.error(`Unhandled error catched: ${e}`); +}); + app.listen(port, () => { return console.log(`Briques is listening at http://localhost:${port}`); });