Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 23, 2025

The collections page was incorrectly displaying shared collections in the "owned" tab because the frontend was calling the wrong API endpoint.

Problem

The frontend was fetching owned collections from /api/collections/ which returns both owned AND shared collections, causing shared collections to appear in the owned tab where they shouldn't be.

Backend API Analysis

  • /api/collections/ (list method): Q(user=request.user.id) | Q(shared_with=request.user) - returns both owned and shared collections
  • /api/collections/all/ (all method): Q(user=request.user) - returns only owned collections
  • /api/collections/shared/ (shared method): shared_with=request.user - returns only shared collections

Solution

Changed the frontend to use the correct endpoint for owned collections in /frontend/src/routes/collections/+page.server.ts:

- const apiUrl = `${serverEndpoint}/api/collections/?order_by=${order_by}&order_direction=${order_direction}&page=${page}&nested=true`;
+ const apiUrl = `${serverEndpoint}/api/collections/all/?order_by=${order_by}&order_direction=${order_direction}&page=${page}&nested=true`;

Impact

  • Before: Owned tab showed owned + shared collections (incorrect)
  • After: Owned tab shows only owned collections (correct)
  • No regression: Shared and archived tabs continue using their correct dedicated endpoints

This ensures proper separation of collections across the three tabs: owned collections only appear in the "owned" tab, shared collections only appear in the "shared" tab, and archived collections only appear in the "archived" tab.

Fixes #875.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 127.0.0.11
  • flagcdn.com
    • Triggering command: python manage.py download-countries (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link

vercel bot commented Sep 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
adventurelog Ready Ready Preview Comment Sep 23, 2025 3:26am

Copilot AI changed the title [WIP] [BUG] Shared Collections In Owned Tab Fix shared collections appearing in owned tab by using correct API endpoint Sep 23, 2025
Copilot AI requested a review from seanmorley15 September 23, 2025 03:28
Copilot finished work on behalf of seanmorley15 September 23, 2025 03:28
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.

[BUG] Shared Collections In Owned Tab

2 participants