Skip to content

feat(api): Enable anonymous read access and server-side pagination for core resources:#58

Merged
AvishkarPatil merged 1 commit intoAvishkarPatil:mainfrom
Sainava:55-Enable-Public-Read-Access
Sep 6, 2025
Merged

feat(api): Enable anonymous read access and server-side pagination for core resources:#58
AvishkarPatil merged 1 commit intoAvishkarPatil:mainfrom
Sainava:55-Enable-Public-Read-Access

Conversation

@Sainava
Copy link
Contributor

@Sainava Sainava commented Sep 5, 2025

📝 Description

Enable anonymous read access and server-side pagination for core resources:

Permissions: IsAuthenticatedOrReadOnly for Region, Category, Technique (writes still auth-only).
Visibility: TechniqueViewSet returns all for staff; only is_published=True for others.
Pagination: Global PageNumberPagination via DefaultPagination (page_size=12, page_size query param).
Docs: [API_Documentation.md] updated with “Pagination & Filtering,” query params, examples, and response shape.
Tests: Added APITestCase for anonymous/staff visibility and pagination (including page_size override).

🔗 Related Issue

Fixes #55

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 UI/UX improvement
  • ⚡ Performance improvement

🧪 Testing

  • I have performed a self-review of my code
  • Code has been tested locally
  • Tests pass (if applicable)
  • No new warnings introduced

📱 Frontend Changes (if applicable)

  • Responsive design tested
  • Cross-browser compatibility checked
  • Accessibility guidelines followed

🔧 Backend Changes (if applicable)

  • Database migrations created (if needed)
  • API endpoints tested
  • Authentication/authorization verified

📋 Additional Notes

Optional follow-up: add default ordering in Category/Region Meta to silence pagination warnings.
Frontend should consume results and use next/previous for pagination; no breaking changes to write endpoints.

✅ Checklist

  • My code follows the project's coding standards
  • I have updated documentation where necessary
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

This will be an official contribution for OSCI'25

@github-actions
Copy link

github-actions bot commented Sep 5, 2025

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

@AvishkarPatil
Copy link
Owner

@Sainava Thanks for update

@AvishkarPatil AvishkarPatil merged commit 80f6e44 into AvishkarPatil:main Sep 6, 2025
1 check passed
AvishkarPatil added a commit that referenced this pull request Sep 6, 2025
- Support new paginated API format from PR #58
- Add safety checks for threads array iteration
- Fix forum showing empty after API changes
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.

[FEATURE] Enable Public Read Access and API Pagination for Techniques, Categories, and Regions

2 participants