Women-Coding-Community / wcc-backend

Backend for Women Coding Community Platform Project
MIT License
5 stars 12 forks source link

feat: Create event pagination page #72

Open dricazenck opened 3 months ago

dricazenck commented 3 months ago

The /events api needs to be paginated.

goelsonali commented 1 week ago

@dricazenck -

can you confirm if this structure for the paginated response looks correct ? + do you want me to replace the "events" field with "items" to be generic ?

{
  "metadata": {
    "totalItems": null,
    "totalPages": 3,
    "currentPage": 1,
    "pageSize": null
  },
  "data": {
    "hero": {
      "title": "Online and In-Person Events",
      "description": "Join the Women Coding Community for events and meetups that enhance your skills, deepen your knowledge, and expand your professional network.\n\nOur events include webinars, hands-on workshops, study groups, panel discussions, and keynotes with industry experts. Whether online or in-person, these gatherings offer valuable opportunities to share insights, learn collaboratively, and stay updated on the latest trends. Connect, grow, and thrive with fellow members in a supportive environment.",
      "image": {
        "path": "https://cloudprovider.com/image.png",
        "alt": "There is a group of women showing WCC logo",
        "type": "DESKTOP"
      }
    },
    "contact": {
      "title": "Contact us",
      "links": [
        {
          "type": "EMAIL",
          "link": "london@womencodingcommunity.com"
        },
        {
          "type": "SLACK",
          "link": "https://join.slack.com/t/womencodingcommunity/shared_invite/zt-2hpjwpx7l-rgceYBIWp6pCiwc0hVsX8A"
        }
      ]
    },
    "events": [
      {
        "topics": "Book Club",
        "eventType": "IN_PERSON",
        "startDate": "THU, MAY 30, 2024, 8:00 PM CEST",
        "endDate": "THU, MAY 30, 2024, 9.30 CEST",
        "title": "Book Club: The Pragmatic Programmer",
        "speakerProfile": {
          "label": "John Doe",
          "uri": "https://meetup.com/event1"
        },
        "hostProfile": {
          "label": "John M",
          "uri": "https://meetup.com/event1"
        },
        "description": "Join us for a discussion of this essential guide to writing clear and maintainable code!",
        "images": [
          {
            "path": "https://cloudprovider.com/image.png",
            "alt": "Pragmatic programmer book cover",
            "type": "DESKTOP"
          }
        ],
        "eventLink": {
          "label": "Go to Meetup Event",
          "uri": "https://meetup.com/event1"
        },
        "eventResources": [
          {
            "link": {
              "label": "Slides",
              "uri": "https://googledrive/event1"
            }
          },
          {
            "link": {
              "label": "Recording",
              "uri": "https://meetup.com/event1"
            }
          }
        ]
      }
    ]
  }
}
dricazenck commented 1 day ago

@goelsonali yes that is correct, and we should be using more generic items instead of events.

Please have a look in: PageData, PageMetadata and Pagination.