From faf563d4dd0bdd10d957b12b83f5544d4719372c Mon Sep 17 00:00:00 2001
From: Rosanny <rosanny.sihombing@hft-stuttgart.de>
Date: Tue, 2 Nov 2021 17:04:39 +0100
Subject: [PATCH] show only (re)deployed websites

---
 routes/project.ts | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/routes/project.ts b/routes/project.ts
index 802062b..86bce9b 100644
--- a/routes/project.ts
+++ b/routes/project.ts
@@ -2,6 +2,7 @@
 import methods from '../functions/methods'
 import gitlab from '../functions/gitlab'
 import helpers from '../functions/helpers'
+import https from 'https'
 
 module.exports = function (app:any, lang:string) {
  
@@ -142,7 +143,7 @@ module.exports = function (app:any, lang:string) {
 
   // Projektinformationen
   app.get('/projektinformationen', async function(req:any, res:any){
-    let pagesArr = []
+    let pagesArr: { logo: any; name: any; weburl: any; desc: any; keywords: any; createdAt: any; lastUpdatedAt: any; }[] = []
     let isProject = true
     let firstId = 0
     let orderKeyword = req.query.sort
@@ -183,7 +184,12 @@ module.exports = function (app:any, lang:string) {
               createdAt: pagesData[i].created_at,
               lastUpdatedAt: pagesData[i].last_activity_at
             }
-            pagesArr.push(pages)
+
+            https.get(pagesData[i].web_url, function (response:any) {
+              if (response.statusCode >= 200 && response.statusCode <= 299) {
+                pagesArr.push(pages)
+              }
+            })
           }
         }
         firstId = pagesData[pagesData.length-1].id
-- 
GitLab