mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Fixed uuid references in schemas.
Some checks are pending
Node.js CI / build (postgresql, 18.18) (push) Waiting to run
Some checks are pending
Node.js CI / build (postgresql, 18.18) (push) Waiting to run
This commit is contained in:
parent
f40e1b44f3
commit
303947fe9b
16 changed files with 36 additions and 27 deletions
|
|
@ -9,7 +9,7 @@ export function TeamsSettingsPage() {
|
|||
<Column gap="6">
|
||||
<TeamsHeader />
|
||||
<Panel>
|
||||
<TeamsDataTable />
|
||||
<TeamsDataTable showActions={true} />
|
||||
</Panel>
|
||||
</Column>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|||
import Link from 'next/link';
|
||||
import { DataGrid } from '@/components/common/DataGrid';
|
||||
import { TeamsTable } from './TeamsTable';
|
||||
import { useLoginQuery, useUserTeamsQuery } from '@/components/hooks';
|
||||
import { useLoginQuery, useNavigation, useUserTeamsQuery } from '@/components/hooks';
|
||||
|
||||
export function TeamsDataTable({
|
||||
showActions,
|
||||
|
|
@ -13,10 +13,12 @@ export function TeamsDataTable({
|
|||
}) {
|
||||
const { user } = useLoginQuery();
|
||||
const query = useUserTeamsQuery(user.id);
|
||||
const { pathname } = useNavigation();
|
||||
const isSettings = pathname.includes('/settings');
|
||||
|
||||
const renderLink = (row: any) => {
|
||||
return (
|
||||
<Link key={row.id} href={`/teams/${row.id}`}>
|
||||
<Link key={row.id} href={`${isSettings ? '/settings' : ''}/teams/${row.id}`}>
|
||||
{row.name}
|
||||
</Link>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export async function POST(request: Request) {
|
|||
url: z.string().max(500),
|
||||
slug: z.string().max(100),
|
||||
teamId: z.string().nullable().optional(),
|
||||
id: z.string().uuid().nullable().optional(),
|
||||
id: z.uuid().nullable().optional(),
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export async function POST(request: Request) {
|
|||
name: z.string().max(100),
|
||||
slug: z.string().max(100),
|
||||
teamId: z.string().nullable().optional(),
|
||||
id: z.string().uuid().nullable().optional(),
|
||||
id: z.uuid().nullable().optional(),
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { getReports, createReport } from '@/queries';
|
|||
|
||||
export async function GET(request: Request) {
|
||||
const schema = z.object({
|
||||
websiteId: z.string().uuid().optional(),
|
||||
websiteId: z.uuid().optional(),
|
||||
type: z.string().optional(),
|
||||
...pagingParams,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ const schema = z.object({
|
|||
type: z.enum(['event', 'identify']),
|
||||
payload: z
|
||||
.object({
|
||||
website: z.string().uuid().optional(),
|
||||
link: z.string().uuid().optional(),
|
||||
pixel: z.string().uuid().optional(),
|
||||
website: z.uuid().optional(),
|
||||
link: z.uuid().optional(),
|
||||
pixel: z.uuid().optional(),
|
||||
data: anyObjectParam.optional(),
|
||||
hostname: z.string().max(100).optional(),
|
||||
language: z.string().max(35).optional(),
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export async function GET(request: Request, { params }: { params: Promise<{ team
|
|||
|
||||
export async function POST(request: Request, { params }: { params: Promise<{ teamId: string }> }) {
|
||||
const schema = z.object({
|
||||
userId: z.string().uuid(),
|
||||
userId: z.uuid(),
|
||||
role: teamRoleParam,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { createUser, getUserByUsername } from '@/queries';
|
|||
|
||||
export async function POST(request: Request) {
|
||||
const schema = z.object({
|
||||
id: z.string().uuid().optional(),
|
||||
id: z.uuid().optional(),
|
||||
username: z.string().max(255),
|
||||
password: z.string(),
|
||||
role: z.string().regex(/admin|user|view-only/i),
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ export async function POST(
|
|||
{ params }: { params: Promise<{ websiteId: string }> },
|
||||
) {
|
||||
const schema = z.object({
|
||||
userId: z.string().uuid().optional(),
|
||||
teamId: z.string().uuid().optional(),
|
||||
userId: z.uuid().optional(),
|
||||
teamId: z.uuid().optional(),
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export async function POST(request: Request) {
|
|||
domain: z.string().max(500),
|
||||
shareId: z.string().max(50).nullable().optional(),
|
||||
teamId: z.string().nullable().optional(),
|
||||
id: z.string().uuid().nullable().optional(),
|
||||
id: z.uuid().nullable().optional(),
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue