Skip to content

Feat/upload#79

Merged
ayshadogo merged 5 commits into
Dfunder:mainfrom
ummarig:feat/upload
Jun 21, 2026
Merged

Feat/upload#79
ayshadogo merged 5 commits into
Dfunder:mainfrom
ummarig:feat/upload

Conversation

@ummarig

@ummarig ummarig commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

✅ Completed

Implemented GET /api/projects/:id and added test coverage.

What changed

  • project.routes.js

    • Added GET /api/projects/:id
    • Uses optional auth so endpoint works without login
  • project.controller.js

    • Added getProjectById
    • Populates owner fullName only
    • Returns 404 for missing projects
    • Returns 404 for inactive projects unless requester is owner or admin
  • Project.model.js

    • Added isActive field with default true
  • auth.js

    • Added optionalAuthenticate helper to support unauthenticated GET access
  • project.routes.test.js

    • Added route tests for:
      • valid active project
      • missing project
      • inactive project hidden from public
      • inactive project visible to owner
      • inactive project visible to admin

Validation

  • npm test -- --runInBand src/__tests__/project.routes.test.js
  • Result: 5 passed

If you want, I can also add an integration test for full project data structure.

Closes #72

Made changes.

@ayshadogo ayshadogo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thank you for your contribution

@ayshadogo ayshadogo merged commit b69569f into Dfunder:main Jun 21, 2026
1 check passed
@grantfox-oss grantfox-oss Bot mentioned this pull request Jun 21, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upload Project Cover Image

2 participants