Skip to content

Commit a505459

Browse files
committed
Add prefix parameter to fps-contents
1 parent 31026bd commit a505459

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

jupyverse_api/jupyverse_api/contents/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def unwatch(self, path: str, watcher):
3131

3232

3333
class Contents(Router, ABC):
34-
def __init__(self, app: App, auth: Auth):
34+
def __init__(self, app: App, auth: Auth, prefix: str = ""):
3535
super().__init__(app=app)
3636

3737
router = APIRouter()
@@ -104,7 +104,7 @@ async def rename_content(
104104
) -> Content:
105105
return await self.rename_content(path, request, user)
106106

107-
self.include_router(router)
107+
self.include_router(router, prefix=prefix)
108108

109109
@property
110110
@abstractmethod

plugins/contents/fps_contents/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@
77

88

99
class ContentsComponent(Component):
10+
def __init__(
11+
self,
12+
prefix: str = "",
13+
) -> None:
14+
super().__init__()
15+
self.prefix = prefix
16+
1017
async def start(
1118
self,
1219
ctx: Context,
1320
) -> None:
1421
app = await ctx.request_resource(App)
1522
auth = await ctx.request_resource(Auth) # type: ignore
1623

17-
contents = _Contents(app, auth)
24+
contents = _Contents(app, auth, self.prefix)
1825
ctx.add_resource(contents, types=Contents)

0 commit comments

Comments
 (0)