Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e72e14b
feat: added user search field (#3771)
kage1414 Aug 17, 2024
52e8a2c
feat: add search query (#3771)
kage1414 Aug 17, 2024
f51a5fb
feat: search from db (#3771)
kage1414 Aug 17, 2024
9aff74e
refactor(userlist): cleanup request payload and BE handling
kage1414 Aug 17, 2024
8e65598
refactor(user list): move user list back to one component
kage1414 Aug 18, 2024
c720ffe
refactor(loading indicator): show loading indicator if no data and if…
kage1414 Aug 18, 2024
037ee45
style(search bar width): cleanup excess containers. adjust width
kage1414 Aug 18, 2024
34829fe
style(search bar dimensions): cleans up styling on user search bar
kage1414 Aug 18, 2024
776f14b
fix(loading state & url encode): only show loading indicator if data …
kage1414 Aug 18, 2024
52729b6
feat(update i18n): adds placeholder to i18n
kage1414 Aug 18, 2024
945a178
refactor(user list): add custom hook for fetching users
kage1414 Oct 6, 2024
a1df4a2
Merge branch 'develop' into search-box-for-users
kage1414 Oct 6, 2024
7658dae
test(userlist): remove wait for user call
kage1414 Oct 11, 2024
5c8c107
Merge branch 'develop' of https://github.com/sct/overseerr into searc…
kage1414 Jan 23, 2025
337ee3c
feat: added user search field (#3771)
kage1414 Aug 17, 2024
6da51b8
feat: add search query (#3771)
kage1414 Aug 17, 2024
52ba7ab
feat: search from db (#3771)
kage1414 Aug 17, 2024
e70a852
refactor(userlist): cleanup request payload and BE handling
kage1414 Aug 17, 2024
0752b62
refactor(user list): move user list back to one component
kage1414 Aug 18, 2024
0340ec2
refactor(loading indicator): show loading indicator if no data and if…
kage1414 Aug 18, 2024
b62395e
style(search bar width): cleanup excess containers. adjust width
kage1414 Aug 18, 2024
9743d7c
style(search bar dimensions): cleans up styling on user search bar
kage1414 Aug 18, 2024
0547592
fix(loading state & url encode): only show loading indicator if data …
kage1414 Aug 18, 2024
895c7a4
feat(update i18n): adds placeholder to i18n
kage1414 Aug 18, 2024
d4b4f6f
refactor(user list): add custom hook for fetching users
kage1414 Oct 6, 2024
e43423a
test(userlist): remove wait for user call
kage1414 Oct 11, 2024
dfca1e6
feat: add support for requesting "Specials" for TV Shows (#3724)
AhmedNSidd Oct 21, 2024
14cb831
docs: add AhmedNSidd as a contributor for code (#3964) [skip ci]
allcontributors[bot] Oct 21, 2024
90e9897
feat(lang): Translations update from Hosted Weblate (#3835)
weblate Jan 19, 2025
cf6e03a
Merge branch 'search-box-for-users' of github.com:kage1414/overseerr …
kage1414 Feb 1, 2025
00783e9
Merge branch 'develop' into search-box-for-users
kage1414 Apr 29, 2025
770aeb5
Merge branch 'develop' into search-box-for-users
kage1414 May 28, 2025
8539d28
Merge branch 'develop' into search-box-for-users
kage1414 Oct 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cypress/e2e/user/user-list.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ describe('User List', () => {

cy.get('[data-testid=modal-ok-button]').click();

cy.wait('@user');
// Wait a little longer for the user list to fully re-render
cy.wait(1000);

Expand All @@ -60,7 +59,6 @@ describe('User List', () => {

cy.get('[data-testid=modal-ok-button]').should('contain', 'Delete').click();

cy.wait('@user');
cy.wait(1000);

cy.get('[data-testid=user-list-row]')
Expand Down
6 changes: 6 additions & 0 deletions overseerr-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3460,6 +3460,12 @@ paths:
type: string
enum: [created, updated, requests, displayname]
default: created
- in: query
name: searchQuery
schema:
type: string
nullable: true
example: 'steve@gmail.com'
responses:
'200':
description: A JSON array of all users
Expand Down
7 changes: 7 additions & 0 deletions server/routes/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ router.get('/', async (req, res, next) => {
try {
const pageSize = req.query.take ? Number(req.query.take) : 10;
const skip = req.query.skip ? Number(req.query.skip) : 0;
const searchQuery = req.query.searchQuery;
let query = getRepository(User).createQueryBuilder('user');

if (searchQuery) {
await query.where('user.email like :query OR user.username like :query', {
query: `%${searchQuery}%`,
});
}

switch (req.query.sort) {
case 'updated':
query = query.orderBy('user.updatedAt', 'DESC');
Expand Down
36 changes: 36 additions & 0 deletions src/components/UserList/hooks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type { Sort } from '@app/components/UserList';
import type { User } from '@app/hooks/useUser';
import type { UserResultsResponse } from '@server/interfaces/api/userInterfaces';
import { isEqual } from 'lodash';
import { useEffect, useState } from 'react';
import useSWR from 'swr';

export const useUsers = ({
pageIndex,
currentPageSize,
searchString,
currentSort,
}: {
pageIndex: number;
currentPageSize: number;
searchString: string;
currentSort: Sort;
}) => {
const [users, setUsers] = useState<User[]>([]);

const { data, mutate, isLoading } = useSWR<UserResultsResponse>(
`/api/v1/user?take=${currentPageSize}&skip=${
pageIndex * currentPageSize
}&searchQuery=${
searchString ? encodeURIComponent(searchString) : '%00'
}&sort=${currentSort}`
);

useEffect(() => {
if (!isLoading && data?.results && !isEqual(data.results, users)) {
setUsers(data.results);
}
}, [isLoading, data?.results, users]);

return { users, mutate, isLoading, pageInfo: data?.pageInfo };
};
Loading