Merged
Conversation
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces community collection management backed by the CM database, migrating collection read endpoints away from Tinybird and adding authenticated CRUD endpoints for a user’s own collections.
Changes:
- Enable CM DB usage via runtime config and wire CM DB pool into
/api/collection*requests. - Replace Tinybird-backed
/api/collectionand/api/collection/:slugwith CM DB queries. - Add repositories + new authenticated endpoints to create/update/delete/list a user’s community collections.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/setup/runtime-config.ts | Makes CM DB enablement configurable via NUXT_CM_DB_ENABLED (still always on in prod). |
| frontend/setup/caching.ts | Disables caching for community collection management endpoints. |
| frontend/server/utils/common.ts | Adds a shared generateSlug() helper using slugify. |
| frontend/server/repo/insightsSsoUser.repo.ts | New CM DB repository to upsert/look up SSO users. |
| frontend/server/repo/communityCollection.repo.ts | New CM DB repository implementing collection CRUD and list/detail queries. |
| frontend/server/middleware/jwt-auth.ts | Protects /api/collection/community* routes with JWT auth. |
| frontend/server/middleware/database.ts | Injects DB pools for /api/collection* routes. |
| frontend/server/api/collection/index.ts | Migrates collection listing from Tinybird to CM DB repository query. |
| frontend/server/api/collection/community/my.get.ts | Adds “my collections” endpoint for authenticated user. |
| frontend/server/api/collection/community/index.post.ts | Adds authenticated endpoint to create a community collection. |
| frontend/server/api/collection/community/[id].put.ts | Adds authenticated endpoint to update a community collection. |
| frontend/server/api/collection/community/[id].delete.ts | Adds authenticated endpoint to soft-delete a community collection. |
| frontend/server/api/collection/[slug].ts | Migrates collection detail-by-slug from Tinybird to CM DB. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+65
to
+71
| const repo = new CommunityCollectionRepository(cmDbPool); | ||
| return await repo.update(id, ssoUser.id, { | ||
| name: body.name?.trim(), | ||
| description: body.description?.trim(), | ||
| isPrivate: body.isPrivate, | ||
| projects: body.projects, | ||
| }); |
There was a problem hiding this comment.
When updating, name: body.name?.trim() will turn a whitespace-only value into an empty string, which then updates the collection name/slug to ''. If name is provided, validate it after trimming (non-empty), or treat empty/whitespace-only input as "no update" (i.e. undefined).
emlimlf
approved these changes
Mar 6, 2026
joanagmaia
reviewed
Mar 6, 2026
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.