diff --git a/components/metrics/ActiveUsers.js b/components/metrics/ActiveUsers.js
index 6b7c4779..0ab266d3 100644
--- a/components/metrics/ActiveUsers.js
+++ b/components/metrics/ActiveUsers.js
@@ -5,7 +5,7 @@ import useFetch from 'hooks/useFetch';
import Dot from 'components/common/Dot';
import styles from './ActiveUsers.module.css';
-export default function ActiveUsers({ websiteId, className, value, interval = 600000 }) {
+export default function ActiveUsers({ websiteId, className, value, interval = 60000 }) {
const url = websiteId ? `/websites/${websiteId}/active` : null;
const { data } = useFetch(url, {
interval,
diff --git a/components/settings/WebsiteSettings.js b/components/settings/WebsiteSettings.js
index f044bd68..80bd1f60 100644
--- a/components/settings/WebsiteSettings.js
+++ b/components/settings/WebsiteSettings.js
@@ -46,7 +46,7 @@ export default function WebsiteSettings() {
icon={}
size="small"
tooltip={}
- tooltipId={`button-share-${row.id}`}
+ tooltipId={`button-share-${row.websiteUuid}`}
onClick={() => setShowUrl(row)}
/>
)}
@@ -56,42 +56,46 @@ export default function WebsiteSettings() {
tooltip={
}
- tooltipId={`button-code-${row.id}`}
+ tooltipId={`button-code-${row.websiteUuid}`}
onClick={() => setShowCode(row)}
/>
}
size="small"
tooltip={}
- tooltipId={`button-edit-${row.id}`}
+ tooltipId={`button-edit-${row.websiteUuid}`}
onClick={() => setEditWebsite(row)}
/>
}
size="small"
tooltip={}
- tooltipId={`button-reset-${row.id}`}
+ tooltipId={`button-reset-${row.websiteUuid}`}
onClick={() => setResetWebsite(row)}
/>
}
size="small"
tooltip={}
- tooltipId={`button-delete-${row.id}`}
+ tooltipId={`button-delete-${row.websiteUuid}`}
onClick={() => setDeleteWebsite(row)}
/>
);
- const DetailsLink = ({ id, name, domain }) => (
-
+ const DetailsLink = ({ websiteUuid, name, domain }) => (
+
- {name}
+ {name}
);
- const Domain = ({ domain, id }) => (
- {domain}
+ const Domain = ({ domain, websiteUuid }) => (
+ {domain}
);
const adminColumns = [
@@ -199,7 +203,7 @@ export default function WebsiteSettings() {
title={}
>
@@ -210,7 +214,7 @@ export default function WebsiteSettings() {
title={}
>
diff --git a/queries/admin/website/deleteWebsite.js b/queries/admin/website/deleteWebsite.js
index 392bdbae..b5e2ff76 100644
--- a/queries/admin/website/deleteWebsite.js
+++ b/queries/admin/website/deleteWebsite.js
@@ -1,27 +1,27 @@
import prisma from 'lib/prisma';
import redis, { DELETED } from 'lib/redis';
-import { getWebsiteById } from 'queries';
+import { getWebsiteByUuid } from 'queries';
export async function deleteWebsite(websiteId) {
const { client, transaction } = prisma;
- const { websiteUuid } = await getWebsiteById(websiteId);
+ const { websiteUuid } = await getWebsiteByUuid(websiteId);
return transaction([
client.pageview.deleteMany({
- where: { session: { website: { id: websiteId } } },
+ where: { session: { website: { websiteUuid: websiteId } } },
}),
client.eventData.deleteMany({
- where: { event: { session: { website: { id: websiteId } } } },
+ where: { event: { session: { website: { websiteUuid: websiteId } } } },
}),
client.event.deleteMany({
- where: { session: { website: { id: websiteId } } },
+ where: { session: { website: { websiteUuid: websiteId } } },
}),
client.session.deleteMany({
- where: { website: { id: websiteId } },
+ where: { website: { websiteUuid: websiteId } },
}),
client.website.delete({
- where: { id: websiteId },
+ where: { websiteUuid: websiteId },
}),
]).then(async res => {
if (redis.client) {
diff --git a/queries/admin/website/resetWebsite.js b/queries/admin/website/resetWebsite.js
index d097d4e5..d969b0d0 100644
--- a/queries/admin/website/resetWebsite.js
+++ b/queries/admin/website/resetWebsite.js
@@ -5,16 +5,16 @@ export async function resetWebsite(websiteId) {
return transaction([
client.pageview.deleteMany({
- where: { session: { website: { id: websiteId } } },
+ where: { session: { website: { websiteUuid: websiteId } } },
}),
client.eventData.deleteMany({
- where: { event: { session: { website: { id: websiteId } } } },
+ where: { event: { session: { website: { websiteUuid: websiteId } } } },
}),
client.event.deleteMany({
- where: { session: { website: { id: websiteId } } },
+ where: { session: { website: { websiteUuid: websiteId } } },
}),
client.session.deleteMany({
- where: { website: { id: websiteId } },
+ where: { website: { websiteUuid: websiteId } },
}),
]);
}