mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 00:27:11 +01:00
Update useValidate calls.
This commit is contained in:
parent
5e3c135388
commit
0d9b6e8355
37 changed files with 38 additions and 106 deletions
|
|
@ -35,9 +35,7 @@ export default async (
|
|||
res: NextApiResponse<Team>,
|
||||
) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
req.yup = schema;
|
||||
await useValidate(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
const { id: teamId } = req.query;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,7 @@ const schema = {
|
|||
|
||||
export default async (req: NextApiRequestQueryBody<TeamUserRequestQuery>, res: NextApiResponse) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
req.yup = schema;
|
||||
await useValidate(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
if (req.method === 'DELETE') {
|
||||
const { id: teamId, userId } = req.query;
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@ export default async (
|
|||
res: NextApiResponse,
|
||||
) => {
|
||||
await useAuth(req, res);
|
||||
req.yup = schema;
|
||||
await useValidate(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
const { id: teamId } = req.query;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@ export default async (
|
|||
res: NextApiResponse,
|
||||
) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
req.yup = schema;
|
||||
await useValidate(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
const { id: teamId, websiteId } = req.query;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ export default async (
|
|||
res: NextApiResponse,
|
||||
) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
req.yup = schema;
|
||||
await useValidate(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
const { id: teamId } = req.query;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@ export default async (
|
|||
res: NextApiResponse<Team[] | Team>,
|
||||
) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
req.yup = schema;
|
||||
await useValidate(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
const {
|
||||
user: { id: userId },
|
||||
|
|
|
|||
|
|
@ -21,9 +21,7 @@ export default async (
|
|||
res: NextApiResponse<Team>,
|
||||
) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
req.yup = schema;
|
||||
await useValidate(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
if (req.method === 'POST') {
|
||||
const { accessCode } = req.body;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue