mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
parent
3072f02f1b
commit
912d2d544d
4 changed files with 19 additions and 1 deletions
|
|
@ -1,8 +1,14 @@
|
||||||
import type { Metadata } from 'next';
|
import type { Metadata } from 'next';
|
||||||
|
import { getLink } from '@/queries/prisma';
|
||||||
import { LinkPage } from './LinkPage';
|
import { LinkPage } from './LinkPage';
|
||||||
|
|
||||||
export default async function ({ params }: { params: Promise<{ linkId: string }> }) {
|
export default async function ({ params }: { params: Promise<{ linkId: string }> }) {
|
||||||
const { linkId } = await params;
|
const { linkId } = await params;
|
||||||
|
const link = await getLink(linkId);
|
||||||
|
|
||||||
|
if (!link || link?.deletedAt) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return <LinkPage linkId={linkId} />;
|
return <LinkPage linkId={linkId} />;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
import type { Metadata } from 'next';
|
import type { Metadata } from 'next';
|
||||||
|
import { getPixel } from '@/queries/prisma';
|
||||||
import { PixelPage } from './PixelPage';
|
import { PixelPage } from './PixelPage';
|
||||||
|
|
||||||
export default async function ({ params }: { params: { pixelId: string } }) {
|
export default async function ({ params }: { params: { pixelId: string } }) {
|
||||||
const { pixelId } = await params;
|
const { pixelId } = await params;
|
||||||
|
const pixel = await getPixel(pixelId);
|
||||||
|
|
||||||
|
if (!pixel || pixel?.deletedAt) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return <PixelPage pixelId={pixelId} />;
|
return <PixelPage pixelId={pixelId} />;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import type { Metadata } from 'next';
|
import type { Metadata } from 'next';
|
||||||
import { WebsiteLayout } from '@/app/(main)/websites/[websiteId]/WebsiteLayout';
|
import { WebsiteLayout } from '@/app/(main)/websites/[websiteId]/WebsiteLayout';
|
||||||
|
import { getWebsite } from '@/queries/prisma';
|
||||||
|
|
||||||
export default async function ({
|
export default async function ({
|
||||||
children,
|
children,
|
||||||
|
|
@ -9,6 +10,11 @@ export default async function ({
|
||||||
params: Promise<{ websiteId: string }>;
|
params: Promise<{ websiteId: string }>;
|
||||||
}) {
|
}) {
|
||||||
const { websiteId } = await params;
|
const { websiteId } = await params;
|
||||||
|
const website = await getWebsite(websiteId);
|
||||||
|
|
||||||
|
if (!website || website?.deletedAt) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return <WebsiteLayout websiteId={websiteId}>{children}</WebsiteLayout>;
|
return <WebsiteLayout websiteId={websiteId}>{children}</WebsiteLayout>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ export async function setWebsiteDate(websiteId: string, userId: string, data: Re
|
||||||
const website = await fetchWebsite(websiteId);
|
const website = await fetchWebsite(websiteId);
|
||||||
const cloudMode = !!process.env.CLOUD_MODE;
|
const cloudMode = !!process.env.CLOUD_MODE;
|
||||||
|
|
||||||
if (cloudMode && !website.teamId) {
|
if (cloudMode && website && !website.teamId) {
|
||||||
const account = await fetchAccount(userId);
|
const account = await fetchAccount(userId);
|
||||||
|
|
||||||
if (!account?.hasSubscription) {
|
if (!account?.hasSubscription) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue