Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Updated validations for websites.
Mike Cao1325abe31d66
diff --git a/src/app/(main)/settings/websites/[id]/page.js b/src/app/(main)/settings/websites/[id]/page.jsindex bdf3b076f..37324659a 100644--- a/src/app/(main)/settings/websites/[id]/page.js+++ b/src/app/(main)/settings/websites/[id]/page.js@@ -1,15 +1,9 @@import WebsiteSettings from '../WebsiteSettings';-async function getDisabled() {- return !!process.env.CLOUD_MODE;-}--export default async function WebsiteSettingsPage({ params }) {- const disabled = await getDisabled();-- if (!params.id || disabled) {+export default async function WebsiteSettingsPage({ params: { id } }) {+ if (process.env.cloudMode) {return null;}- return <WebsiteSettings websiteId={params.id} />;+ return <WebsiteSettings websiteId={id} />;}diff --git a/src/pages/api/websites/[id]/index.ts b/src/pages/api/websites/[id]/index.tsindex 084d0fea4..02e317868 100644--- a/src/pages/api/websites/[id]/index.ts+++ b/src/pages/api/websites/[id]/index.ts@@ -24,9 +24,9 @@ const schema = {}),POST: yup.object().shape({id: yup.string().uuid().required(),- name: yup.string().required(),- domain: yup.string().required(),- shareId: yup.string().matches(SHARE_ID_REGEX, { excludeEmptyString: true }),+ name: yup.string(),+ domain: yup.string(),+ shareId: yup.string().matches(SHARE_ID_REGEX, { excludeEmptyString: true }).nullable(),}),};diff --git a/src/pages/api/websites/index.ts b/src/pages/api/websites/index.tsindex d28e49e2d..b30681cfc 100644--- a/src/pages/api/websites/index.ts+++ b/src/pages/api/websites/index.ts@@ -24,7 +24,7 @@ const schema = {POST: yup.object().shape({name: yup.string().max(100).required(),domain: yup.string().max(500).required(),- shareId: yup.string().max(50),+ shareId: yup.string().max(50).nullable(),}),};