mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Removed getMessage from errors.
This commit is contained in:
parent
be319322c0
commit
7bb89b28be
3 changed files with 6 additions and 6 deletions
|
|
@ -11,7 +11,7 @@ import {
|
||||||
import { useApi, useMessages, useModified } from '@/components/hooks';
|
import { useApi, useMessages, useModified } from '@/components/hooks';
|
||||||
|
|
||||||
export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose: () => void }) {
|
export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose: () => void }) {
|
||||||
const { formatMessage, labels, getMessage } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { post, useMutation } = useApi();
|
const { post, useMutation } = useApi();
|
||||||
const { mutate, error } = useMutation({ mutationFn: (data: any) => post('/teams/join', data) });
|
const { mutate, error } = useMutation({ mutationFn: (data: any) => post('/teams/join', data) });
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
|
|
@ -28,7 +28,7 @@ export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose:
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form ref={ref} onSubmit={handleSubmit} error={error && getMessage(error)}>
|
<Form ref={ref} onSubmit={handleSubmit} error={error}>
|
||||||
<FormRow label={formatMessage(labels.accessCode)}>
|
<FormRow label={formatMessage(labels.accessCode)}>
|
||||||
<FormInput name="accessCode" rules={{ required: formatMessage(labels.required) }}>
|
<FormInput name="accessCode" rules={{ required: formatMessage(labels.required) }}>
|
||||||
<TextField autoComplete="off" />
|
<TextField autoComplete="off" />
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import Logo from '@/assets/logo.svg';
|
||||||
import styles from './LoginForm.module.css';
|
import styles from './LoginForm.module.css';
|
||||||
|
|
||||||
export function LoginForm() {
|
export function LoginForm() {
|
||||||
const { formatMessage, labels, getMessage } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { post, useMutation } = useApi();
|
const { post, useMutation } = useApi();
|
||||||
const { mutate, error, isPending } = useMutation({
|
const { mutate, error, isPending } = useMutation({
|
||||||
|
|
@ -40,7 +40,7 @@ export function LoginForm() {
|
||||||
<Logo />
|
<Logo />
|
||||||
</Icon>
|
</Icon>
|
||||||
<div className={styles.title}>umami</div>
|
<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)}>
|
<FormRow label={formatMessage(labels.username)}>
|
||||||
<FormInput
|
<FormInput
|
||||||
data-test="input-username"
|
data-test="input-username"
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,11 @@ export async function getUsers(
|
||||||
criteria: UserFindManyArgs,
|
criteria: UserFindManyArgs,
|
||||||
pageParams?: PageParams,
|
pageParams?: PageParams,
|
||||||
): Promise<PageResult<User[]>> {
|
): Promise<PageResult<User[]>> {
|
||||||
const { query } = pageParams;
|
const { search } = pageParams;
|
||||||
|
|
||||||
const where: Prisma.UserWhereInput = {
|
const where: Prisma.UserWhereInput = {
|
||||||
...criteria.where,
|
...criteria.where,
|
||||||
...prisma.getSearchParameters(query, [{ username: 'contains' }]),
|
...prisma.getSearchParameters(search, [{ username: 'contains' }]),
|
||||||
deletedAt: null,
|
deletedAt: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue