refactor: use withResourceFetchingFromRoute for space endpoints#23684
refactor: use withResourceFetchingFromRoute for space endpoints#23684
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
This change is part of the following stack: Change managed by git-spice. |
|
|
|
||
| export default withPublicAPIAuthentication(handler); | ||
| export default withPublicAPIAuthentication( | ||
| withResourceFetchingFromRoute(handler, { space: {} }) |
There was a problem hiding this comment.
no specif rights before, so empty
|
|
||
| export default withPublicAPIAuthentication(handler); | ||
| export default withPublicAPIAuthentication( | ||
| withResourceFetchingFromRoute(handler, { space: {} }) |
There was a problem hiding this comment.
no specif rights before, so empty
|
|
||
| export default withPublicAPIAuthentication(handler); | ||
| export default withPublicAPIAuthentication( | ||
| withResourceFetchingFromRoute(handler, { space: {} }) |
There was a problem hiding this comment.
no specif rights before, so empty
| { space }: { space: SpaceResource } | ||
| ): Promise<void> { | ||
| const { wId, spaceId } = req.query; | ||
| if (!isString(wId)) { |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
we can fetch it from the auth (and it's probably safer)
|
|
||
| export default withPublicAPIAuthentication(handler); | ||
| export default withPublicAPIAuthentication( | ||
| withResourceFetchingFromRoute(handler, { space: {} }) |
There was a problem hiding this comment.
no specif rights before, so empty
| { space }: { space: SpaceResource } | ||
| ): Promise<void> { | ||
| const { wId, spaceId } = req.query; | ||
| if (!isString(wId)) { |
|
|
||
| export default withPublicAPIAuthentication(handler); | ||
| export default withPublicAPIAuthentication( | ||
| withResourceFetchingFromRoute(handler, { space: {} }) |
There was a problem hiding this comment.
no specif rights before, so empty
fd2d5cf to
24ca856
Compare
24ca856 to
3a12232
Compare
Description
Refactoring of spaces API endpoints to use the
withResourceFetchingFromRoutemiddleware, 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