move queries

This commit is contained in:
Brian Cao 2022-07-12 14:14:36 -07:00
parent 910f165103
commit 8aec6d7406
53 changed files with 920 additions and 485 deletions

View file

@ -1,7 +1,7 @@
import { getActiveVisitors } from 'lib/queries';
import { methodNotAllowed, ok, unauthorized } from 'lib/response';
import { allowQuery } from 'lib/auth';
import { useCors } from 'lib/middleware';
import { getActiveVisitors } from 'queries';
export default async (req, res) => {
if (req.method === 'GET') {

View file

@ -1,5 +1,5 @@
import moment from 'moment-timezone';
import { getEventMetrics } from 'lib/queries';
import { getEventMetrics } from 'queries/analytics';
import { ok, badRequest, methodNotAllowed, unauthorized } from 'lib/response';
import { allowQuery } from 'lib/auth';
import { useCors } from 'lib/middleware';

View file

@ -1,4 +1,4 @@
import { deleteWebsite, getWebsiteById } from 'lib/queries';
import { deleteWebsite, getWebsiteById } from 'queries';
import { methodNotAllowed, ok, unauthorized } from 'lib/response';
import { allowQuery } from 'lib/auth';
import { useCors } from 'lib/middleware';

View file

@ -1,4 +1,4 @@
import { getPageviewMetrics, getSessionMetrics, getWebsiteById } from 'lib/queries';
import { getPageviewMetrics, getSessionMetrics, getWebsiteById } from 'queries';
import { ok, methodNotAllowed, unauthorized, badRequest } from 'lib/response';
import { allowQuery } from 'lib/auth';
import { useCors } from 'lib/middleware';

View file

@ -1,5 +1,5 @@
import moment from 'moment-timezone';
import { getPageviewStats } from 'lib/queries';
import { getPageviewStats } from 'queries';
import { ok, badRequest, methodNotAllowed, unauthorized } from 'lib/response';
import { allowQuery } from 'lib/auth';
import { useCors } from 'lib/middleware';

View file

@ -1,4 +1,4 @@
import { resetWebsite } from 'lib/queries';
import { resetWebsite } from 'queries';
import { methodNotAllowed, ok, unauthorized } from 'lib/response';
import { allowQuery } from 'lib/auth';

View file

@ -1,4 +1,4 @@
import { getWebsiteStats } from 'lib/queries';
import { getWebsiteStats } from 'queries';
import { methodNotAllowed, ok, unauthorized } from 'lib/response';
import { allowQuery } from 'lib/auth';
import { useCors } from 'lib/middleware';

View file

@ -1,4 +1,4 @@
import { updateWebsite, createWebsite, getWebsiteById } from 'lib/queries';
import { updateWebsite, createWebsite, getWebsiteById } from 'queries';
import { useAuth } from 'lib/middleware';
import { uuid, getRandomChars } from 'lib/crypto';
import { ok, unauthorized, methodNotAllowed } from 'lib/response';