diff --git a/.github/workflows/one-day-after-reminder-email-task.yml b/.github/workflows/one-day-after-reminder-email-task.yml new file mode 100644 index 0000000..ae97619 --- /dev/null +++ b/.github/workflows/one-day-after-reminder-email-task.yml @@ -0,0 +1,28 @@ +name: One Day After Reminder Email Task + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +jobs: + run-daily-task: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Install dependencies + run: npm install + + - name: Run daily task + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} + WEBSITE_URL: ${{ secrets.WEBSITE_URL }} + run: node .github/workflows/scripts/fetchDataDayAfter.js diff --git a/.github/workflows/scripts/fetchDataDayAfter.js b/.github/workflows/scripts/fetchDataDayAfter.js new file mode 100644 index 0000000..f747e77 --- /dev/null +++ b/.github/workflows/scripts/fetchDataDayAfter.js @@ -0,0 +1,10 @@ +(async () => { + const fetch = await import('node-fetch').then(module => module.default); + + const res = await fetch(`https://rencontres.territoiresentransitions.fr/api/workflow/workflowAfter`, { + method: 'GET' + }); + const data = await res.json(); + console.log(data); + })(); + \ No newline at end of file diff --git a/pages/presence.js b/pages/presence.js index c262ceb..154d68d 100644 --- a/pages/presence.js +++ b/pages/presence.js @@ -78,7 +78,7 @@ export default function Presence() { const minDate = new Date(today); minDate.setDate(today.getDate() - 2); const maxDate = new Date(today); - maxDate.setDate(today.getDate() + 2); + maxDate.setDate(today.getDate() + 6); const filteredSessions = json.filter(session => { const sessionDate = new Date(session.dateDebut); diff --git a/styles/Presence.module.css b/styles/Presence.module.css index eadb9ca..1e48f07 100644 --- a/styles/Presence.module.css +++ b/styles/Presence.module.css @@ -75,6 +75,7 @@ border-radius: 10px; font-weight: 500; justify-content: space-between; + margin-bottom:5px; } .nom{