Skip to content

refactor: use withResourceFetchingFromRoute for space endpoints#23684

Closed
ElPicador wants to merge 1 commit intomainfrom
refactor/withResourceFetchingFromRoute_spaces
Closed

refactor: use withResourceFetchingFromRoute for space endpoints#23684
ElPicador wants to merge 1 commit intomainfrom
refactor/withResourceFetchingFromRoute_spaces

Conversation

@ElPicador
Copy link
Copy Markdown
Contributor

@ElPicador ElPicador commented Apr 3, 2026

Description

Refactoring of spaces API endpoints to use the withResourceFetchingFromRoute middleware, which automatically resolves route parameters (space, dataSource, dataSourceView) into typed resource objects before the handler runs.

Tests

Covered by existing endpoint tests; no new test surface introduced.

Risk

withResourceFetchingFromRoute

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
playground Ignored Ignored Preview Apr 3, 2026 11:42am
storybook Ignored Ignored Preview Apr 3, 2026 11:42am

Request Review

@ElPicador
Copy link
Copy Markdown
Contributor Author

ElPicador commented Apr 3, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Fails
🚫

Files in **/api/v1/ have been modified. Please add the documentation-ack label to acknowledge that if anything changes
in a public endpoint, you need to edit the JSDoc comment
above the handler definition and/or the swagger_schemas.ts file and regenerate the documentation using npm run docs

Generated by 🚫 dangerJS against 3a12232


export default withPublicAPIAuthentication(handler);
export default withPublicAPIAuthentication(
withResourceFetchingFromRoute(handler, { space: {} })
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no specif rights before, so empty


export default withPublicAPIAuthentication(handler);
export default withPublicAPIAuthentication(
withResourceFetchingFromRoute(handler, { space: {} })
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no specif rights before, so empty


export default withPublicAPIAuthentication(handler);
export default withPublicAPIAuthentication(
withResourceFetchingFromRoute(handler, { space: {} })
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no specif rights before, so empty

{ space }: { space: SpaceResource }
): Promise<void> {
const { wId, spaceId } = req.query;
if (!isString(wId)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we can fetch it from the auth (and it's probably safer)

{ space }: { space: SpaceResource }
): Promise<void> {
const { wId, spaceId } = req.query;
if (!isString(wId)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we can fetch it from the auth (and it's probably safer)


export default withPublicAPIAuthentication(handler);
export default withPublicAPIAuthentication(
withResourceFetchingFromRoute(handler, { space: {} })
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no specif rights before, so empty

{ space }: { space: SpaceResource }
): Promise<void> {
const { wId, spaceId } = req.query;
if (!isString(wId)) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agin from auth


export default withPublicAPIAuthentication(handler);
export default withPublicAPIAuthentication(
withResourceFetchingFromRoute(handler, { space: {} })
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no specif rights before, so empty

@ElPicador ElPicador changed the base branch from main to rcs/refator-use April 3, 2026 11:26
@ElPicador ElPicador force-pushed the refactor/withResourceFetchingFromRoute_spaces branch from fd2d5cf to 24ca856 Compare April 3, 2026 11:26
Base automatically changed from rcs/refator-use to main April 3, 2026 11:42
@ElPicador ElPicador force-pushed the refactor/withResourceFetchingFromRoute_spaces branch from 24ca856 to 3a12232 Compare April 3, 2026 11:42
@ElPicador ElPicador closed this Apr 3, 2026
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.

1 participant