Fixed website create.
parent
3b705e6cb4
commit
8a74138e17
|
@ -52,7 +52,7 @@ export async function allowQuery(req, type) {
|
||||||
user: { id: userId },
|
user: { id: userId },
|
||||||
isAdmin,
|
isAdmin,
|
||||||
shareToken,
|
shareToken,
|
||||||
} = req.auth ?? {};
|
} = req.auth;
|
||||||
|
|
||||||
if (isAdmin) {
|
if (isAdmin) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -8,7 +8,7 @@ export default async (req, res) => {
|
||||||
await useAuth(req, res);
|
await useAuth(req, res);
|
||||||
|
|
||||||
if (req.method === 'GET') {
|
if (req.method === 'GET') {
|
||||||
const { userId } = req.auth;
|
const { id: userId } = req.auth.user;
|
||||||
|
|
||||||
const websites = await getUserWebsites(userId);
|
const websites = await getUserWebsites(userId);
|
||||||
const ids = websites.map(({ id }) => id);
|
const ids = websites.map(({ id }) => id);
|
||||||
|
|
|
@ -7,7 +7,10 @@ export default async (req, res) => {
|
||||||
await useCors(req, res);
|
await useCors(req, res);
|
||||||
await useAuth(req, res);
|
await useAuth(req, res);
|
||||||
|
|
||||||
const { userId, isAdmin } = req.auth;
|
const {
|
||||||
|
user: { id: userId },
|
||||||
|
isAdmin,
|
||||||
|
} = req.auth;
|
||||||
|
|
||||||
if (req.method === 'GET') {
|
if (req.method === 'GET') {
|
||||||
const { include_all } = req.query;
|
const { include_all } = req.query;
|
||||||
|
|
Loading…
Reference in New Issue