mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Update endpoints.
This commit is contained in:
parent
4f03bec99e
commit
2b019796be
@ -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