mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-01 20:39:44 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
14cd549e1b
@ -1,10 +1,9 @@
|
|||||||
|
import classNames from 'classnames';
|
||||||
|
import { useMessages, useNavigation } from 'components/hooks';
|
||||||
|
import { safeDecodeURIComponent } from 'next-basics';
|
||||||
|
import Link from 'next/link';
|
||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
import { Icon, Icons } from 'react-basics';
|
import { Icon, Icons } from 'react-basics';
|
||||||
import classNames from 'classnames';
|
|
||||||
import Link from 'next/link';
|
|
||||||
import { safeDecodeURI } from 'next-basics';
|
|
||||||
import { useNavigation } from 'components/hooks';
|
|
||||||
import { useMessages } from 'components/hooks';
|
|
||||||
import styles from './FilterLink.module.css';
|
import styles from './FilterLink.module.css';
|
||||||
|
|
||||||
export interface FilterLinkProps {
|
export interface FilterLinkProps {
|
||||||
@ -40,7 +39,7 @@ export function FilterLink({
|
|||||||
{!value && `(${label || formatMessage(labels.unknown)})`}
|
{!value && `(${label || formatMessage(labels.unknown)})`}
|
||||||
{value && (
|
{value && (
|
||||||
<Link href={renderUrl({ [id]: value })} className={styles.label} replace>
|
<Link href={renderUrl({ [id]: value })} className={styles.label} replace>
|
||||||
{safeDecodeURI(label || value)}
|
{safeDecodeURIComponent(label || value)}
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
{externalUrl && (
|
{externalUrl && (
|
||||||
|
@ -11,26 +11,15 @@ export interface TeamWebsiteRequestQuery extends SearchFilter {
|
|||||||
teamId: string;
|
teamId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TeamWebsiteRequestBody {
|
|
||||||
name: string;
|
|
||||||
domain: string;
|
|
||||||
shareId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const schema = {
|
const schema = {
|
||||||
GET: yup.object().shape({
|
GET: yup.object().shape({
|
||||||
teamId: yup.string().uuid().required(),
|
teamId: yup.string().uuid().required(),
|
||||||
...pageInfo,
|
...pageInfo,
|
||||||
}),
|
}),
|
||||||
POST: yup.object().shape({
|
|
||||||
name: yup.string().max(100).required(),
|
|
||||||
domain: yup.string().max(500).required(),
|
|
||||||
shareId: yup.string().max(50).nullable(),
|
|
||||||
}),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async (
|
export default async (
|
||||||
req: NextApiRequestQueryBody<TeamWebsiteRequestQuery, TeamWebsiteRequestBody>,
|
req: NextApiRequestQueryBody<TeamWebsiteRequestQuery, any>,
|
||||||
res: NextApiResponse,
|
res: NextApiResponse,
|
||||||
) => {
|
) => {
|
||||||
await useAuth(req, res);
|
await useAuth(req, res);
|
||||||
|
@ -10,12 +10,6 @@ export interface UserTeamsRequestQuery extends SearchFilter {
|
|||||||
userId: string;
|
userId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UserTeamsRequestBody {
|
|
||||||
name: string;
|
|
||||||
domain: string;
|
|
||||||
shareId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const schema = {
|
const schema = {
|
||||||
GET: yup.object().shape({
|
GET: yup.object().shape({
|
||||||
userId: yup.string().uuid().required(),
|
userId: yup.string().uuid().required(),
|
||||||
@ -24,7 +18,7 @@ const schema = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default async (
|
export default async (
|
||||||
req: NextApiRequestQueryBody<UserTeamsRequestQuery, UserTeamsRequestBody>,
|
req: NextApiRequestQueryBody<UserTeamsRequestQuery, any>,
|
||||||
res: NextApiResponse,
|
res: NextApiResponse,
|
||||||
) => {
|
) => {
|
||||||
await useCors(req, res);
|
await useCors(req, res);
|
||||||
|
@ -9,8 +9,7 @@ import * as yup from 'yup';
|
|||||||
const schema = {
|
const schema = {
|
||||||
GET: yup.object().shape({
|
GET: yup.object().shape({
|
||||||
userId: yup.string().uuid().required(),
|
userId: yup.string().uuid().required(),
|
||||||
includeTeams: yup.boolean(),
|
teamId: yup.string().uuid(),
|
||||||
onlyTeams: yup.boolean(),
|
|
||||||
...pageInfo,
|
...pageInfo,
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user