Refactored queries.

This commit is contained in:
Mike Cao 2024-01-30 00:10:25 -08:00
parent 18e36aa7b3
commit b16f5cc067
67 changed files with 523 additions and 576 deletions

View file

@ -3,7 +3,7 @@ import { useValidate } from 'lib/middleware';
import { NextApiRequestQueryBody } from 'lib/types';
import { NextApiResponse } from 'next';
import { createToken, methodNotAllowed, notFound, ok } from 'next-basics';
import { getWebsiteByShareId } from 'queries';
import { getSharedWebsite } from 'queries';
import * as yup from 'yup';
export interface ShareRequestQuery {
@ -30,7 +30,7 @@ export default async (
const { id: shareId } = req.query;
if (req.method === 'GET') {
const website = await getWebsiteByShareId(shareId);
const website = await getSharedWebsite(shareId);
if (website) {
const data = { websiteId: website.id };