Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Removed getMessage from errors.

Mike Cao7bb89b28be32
diff --git a/src/app/(main)/settings/teams/TeamJoinForm.tsx b/src/app/(main)/settings/teams/TeamJoinForm.tsx
index 0a82260c7..78be872c3 100644
--- a/src/app/(main)/settings/teams/TeamJoinForm.tsx
+++ b/src/app/(main)/settings/teams/TeamJoinForm.tsx
@@ -11,7 +11,7 @@ import {
import { useApi, useMessages, useModified } from '@/components/hooks';
export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose: () => void }) {
- const { formatMessage, labels, getMessage } = useMessages();
+ const { formatMessage, labels } = useMessages();
const { post, useMutation } = useApi();
const { mutate, error } = useMutation({ mutationFn: (data: any) => post('/teams/join', data) });
const ref = useRef(null);
@@ -28,7 +28,7 @@ export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose:
};
return (
- <Form ref={ref} onSubmit={handleSubmit} error={error && getMessage(error)}>
+ <Form ref={ref} onSubmit={handleSubmit} error={error}>
<FormRow label={formatMessage(labels.accessCode)}>
<FormInput name="accessCode" rules={{ required: formatMessage(labels.required) }}>
<TextField autoComplete="off" />
diff --git a/src/app/login/LoginForm.tsx b/src/app/login/LoginForm.tsx
index a808c622d..1da3106c6 100644
--- a/src/app/login/LoginForm.tsx
+++ b/src/app/login/LoginForm.tsx
@@ -16,7 +16,7 @@ import Logo from '@/assets/logo.svg';
import styles from './LoginForm.module.css';
export function LoginForm() {
- const { formatMessage, labels, getMessage } = useMessages();
+ const { formatMessage, labels } = useMessages();
const router = useRouter();
const { post, useMutation } = useApi();
const { mutate, error, isPending } = useMutation({
@@ -40,7 +40,7 @@ export function LoginForm() {
<Logo />
</Icon>
<div className={styles.title}>umami</div>
- <Form className={styles.form} onSubmit={handleSubmit} error={getMessage(error)}>
+ <Form className={styles.form} onSubmit={handleSubmit} error={error}>
<FormRow label={formatMessage(labels.username)}>
<FormInput
data-test="input-username"
diff --git a/src/queries/prisma/user.ts b/src/queries/prisma/user.ts
index 3edae7003..2e6a478fe 100644
--- a/src/queries/prisma/user.ts
+++ b/src/queries/prisma/user.ts
@@ -51,11 +51,11 @@ export async function getUsers(
criteria: UserFindManyArgs,
pageParams?: PageParams,
): Promise<PageResult<User[]>> {
- const { query } = pageParams;
+ const { search } = pageParams;
const where: Prisma.UserWhereInput = {
...criteria.where,
- ...prisma.getSearchParameters(query, [{ username: 'contains' }]),
+ ...prisma.getSearchParameters(search, [{ username: 'contains' }]),
deletedAt: null,
};