Skip to content

Commit d2166f2

Browse files
page query param name
1 parent 79328da commit d2166f2

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

webui/src/pages/repositories/index.jsx

+11-11
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,17 @@ const GetStarted = ({onCreateSampleRepo, onCreateEmptyRepo, creatingRepo, create
130130
);
131131
};
132132

133-
const RepositoryList = ({ onPaginate, prefix, after, refresh, onCreateSampleRepo, onCreateEmptyRepo, toggleShowActionsBar, creatingRepo, createRepoError }) => {
133+
const RepositoryList = ({ onPaginate, search, after, refresh, onCreateSampleRepo, onCreateEmptyRepo, toggleShowActionsBar, creatingRepo, createRepoError }) => {
134134

135135
const {results, loading, error, nextPage} = useAPIWithPagination(() => {
136-
return repositories.list(prefix, after);
137-
}, [refresh, prefix, after]);
136+
return repositories.list(search, after);
137+
}, [refresh, search, after]);
138138
useEffect(() => {
139139
toggleShowActionsBar();
140140
}, [toggleShowActionsBar]);
141141
if (loading) return <Loading/>;
142142
if (error) return <AlertError error={error}/>;
143-
if (!after && !prefix && results.length === 0) {
143+
if (!after && !search && results.length === 0) {
144144
return <GetStarted onCreateSampleRepo={onCreateSampleRepo} onCreateEmptyRepo={onCreateEmptyRepo} creatingRepo={creatingRepo} createRepoError={createRepoError}/>;
145145
}
146146

@@ -190,10 +190,10 @@ const RepositoriesPage = () => {
190190
const [creatingRepo, setCreatingRepo] = useState(false);
191191
const [showActionsBar, setShowActionsBar] = useState(false);
192192

193-
const routerPfx = (router.query.prefix) ? router.query.prefix : "";
194-
const [prefix, setPrefix] = useDebouncedState(
193+
const routerPfx = (router.query.search) ? router.query.search : "";
194+
const [search, setsearch] = useDebouncedState(
195195
routerPfx,
196-
(prefix) => router.push({pathname: `/repositories`, query: {prefix}})
196+
(search) => router.push({pathname: `/repositories`, query: {search}})
197197
);
198198

199199
const { response, error: err, loading } = useAPI(() => config.getStorageConfig());
@@ -254,8 +254,8 @@ const RepositoriesPage = () => {
254254
<Form.Control
255255
placeholder="Find a repository..."
256256
autoFocus
257-
value={prefix}
258-
onChange={event => setPrefix(event.target.value)}
257+
value={search}
258+
onChange={event => setsearch(event.target.value)}
259259
/>
260260
</InputGroup>
261261
</Col>
@@ -267,12 +267,12 @@ const RepositoriesPage = () => {
267267
</ActionsBar> }
268268

269269
<RepositoryList
270-
prefix={routerPfx}
270+
search={routerPfx}
271271
refresh={refresh}
272272
after={(router.query.after) ? router.query.after : ""}
273273
onPaginate={after => {
274274
const query = {after};
275-
if (router.query.prefix) query.prefix = router.query.prefix;
275+
if (router.query.search) query.search = router.query.search;
276276
router.push({pathname: `/repositories`, query});
277277
}}
278278
onCreateSampleRepo={createSampleRepoButtonCallback}

0 commit comments

Comments
 (0)