Skip to content

Fetch Hackathons Uploaded by Logged-In UserΒ #24

@yuvraj-rathod-1202

Description

@yuvraj-rathod-1202

🧩 Feature / Task

Implement the logic to fetch and display only those hackathons that were uploaded by the currently logged-in user. This requires filtering the hackathons collection in Firestore based on the creatorId.


βœ… Acceptance Criteria

  • The dashboard page (public/dashboard.html) accurately displays only hackathons where creatorId matches the currentUserId.
  • The list of hackathons loads automatically when the dashboard page is accessed.
  • Each hackathon in the list shows relevant details (name, dates, etc.).
  • An appropriate message is displayed if the user has not uploaded any hackathons yet.

🚧 Steps To Do

  1. In scripts/features/dashboard.js, create a function to fetch user-specific hackathons.
  2. Get the current user's ID using firebase.auth().currentUser.uid.
  3. Query the hackathons collection in Firestore: firebase.firestore().collection('hackathons').where('creatorId', '==', currentUserId).get().
  4. Iterate through the fetched documents and dynamically create HTML elements to display each hackathon's details in public/dashboard.html.
  5. Implement error handling and loading states.

πŸ“ Related Files / Areas

  • public/dashboard.html
  • scripts/features/dashboard.js
  • scripts/auth/firebase.js
  • Firebase: Firestore

🧩 Priority

Priority: πŸ”΄ High


πŸ”— Dependencies

Depends on: #1, #21, #23


πŸ–ΌοΈ Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions