useAccountLookup, useGroupLookup: make lookup case insensitive
Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1460
This commit is contained in:
parent
c73cf80d26
commit
0e58f2b505
|
@ -22,7 +22,7 @@ function useAccountLookup(acct: string | undefined, opts: UseAccountLookupOpts =
|
|||
|
||||
const { entity: account, isUnauthorized, ...result } = useEntityLookup<Account>(
|
||||
Entities.ACCOUNTS,
|
||||
(account) => account.acct === acct,
|
||||
(account) => account.acct.toLowerCase() === acct?.toLowerCase(),
|
||||
() => api.get(`/api/v1/accounts/lookup?acct=${acct}`),
|
||||
{ schema: accountSchema, enabled: !!acct },
|
||||
);
|
||||
|
|
|
@ -16,7 +16,7 @@ function useGroupLookup(slug: string) {
|
|||
|
||||
const { entity: group, isUnauthorized, ...result } = useEntityLookup(
|
||||
Entities.GROUPS,
|
||||
(group) => group.slug === slug,
|
||||
(group) => group.slug.toLowerCase() === slug.toLowerCase(),
|
||||
() => api.get(`/api/v1/groups/lookup?name=${slug}`),
|
||||
{ schema: groupSchema, enabled: features.groups && !!slug },
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue