Convert /api/users.
This commit is contained in:
1 parent
090abcff81
commit
baa3851fb4
61 files changed
+1064
-70
No files matched your search
File renamed without changes.
File renamed without changes.
@@ -1,6 +0,0 @@
|
||||
import { NextApiRequest, NextApiResponse } from 'next';
|
||||
import { ok } from 'next-basics';
|
||||
|
||||
export default async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
return ok(res);
|
||||
};
|
||||
@@ -3,7 +3,7 @@ import { NextApiRequestQueryBody } from 'lib/types';
|
||||
import { pageInfo } from 'lib/schema';
|
||||
import { NextApiResponse } from 'next';
|
||||
import { methodNotAllowed } from 'next-basics';
|
||||
import userTeamsRoute from 'pages/api/users/[userId]/teams';
|
||||
import userTeamsRoute from 'pages/api/users/[userId]/_teams';
|
||||
import * as yup from 'yup';
|
||||
|
||||
const schema = {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { NextApiRequestQueryBody } from 'lib/types';
|
||||
import { pageInfo } from 'lib/schema';
|
||||
import { NextApiResponse } from 'next';
|
||||
import { methodNotAllowed } from 'next-basics';
|
||||
import userWebsitesRoute from 'pages/api/users/[userId]/websites';
|
||||
import userWebsitesRoute from 'pages/api/users/[userId]/_websites';
|
||||
import * as yup from 'yup';
|
||||
|
||||
const schema = {
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-2
@@ -33,12 +33,12 @@ export default async (
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const { page, query, pageSize } = req.query;
|
||||
const { page, search, pageSize } = req.query;
|
||||
|
||||
const data = await getWebsiteReports(websiteId, {
|
||||
page,
|
||||
pageSize,
|
||||
query,
|
||||
search,
|
||||
});
|
||||
|
||||
return ok(res, data);
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -5,7 +5,7 @@ import { NextApiRequestQueryBody, PageParams } from 'lib/types';
|
||||
import { NextApiResponse } from 'next';
|
||||
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
|
||||
import { createWebsite } from 'queries';
|
||||
import userWebsitesRoute from 'pages/api/users/[userId]/websites';
|
||||
import userWebsitesRoute from 'pages/api/users/[userId]/_websites';
|
||||
import * as yup from 'yup';
|
||||
import { pageInfo } from 'lib/schema';
|
||||
|
||||
Reference in new issue
Block a user