mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
commit
ab4a60f814
@ -78,7 +78,7 @@ export default function WebsiteEditForm({ values, onSave, onClose }) {
|
|||||||
const [message, setMessage] = useState();
|
const [message, setMessage] = useState();
|
||||||
|
|
||||||
const handleSubmit = async values => {
|
const handleSubmit = async values => {
|
||||||
const { id: websiteId } = values;
|
const { websiteUuid: websiteId } = values;
|
||||||
|
|
||||||
const { ok, data } = await post(websiteId ? `/websites/${websiteId}` : '/websites', values);
|
const { ok, data } = await post(websiteId ? `/websites/${websiteId}` : '/websites', values);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "umami",
|
"name": "umami",
|
||||||
"version": "1.39.2",
|
"version": "1.39.3",
|
||||||
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
|
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
|
||||||
"author": "Mike Cao <mike@mikecao.com>",
|
"author": "Mike Cao <mike@mikecao.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -25,7 +25,7 @@ export default async (req, res) => {
|
|||||||
const websites =
|
const websites =
|
||||||
isAdmin && include_all
|
isAdmin && include_all
|
||||||
? await getAllWebsites()
|
? await getAllWebsites()
|
||||||
: await getUserWebsites({ userId: account.id });
|
: await getUserWebsites({ userId: account?.id });
|
||||||
|
|
||||||
return ok(res, websites);
|
return ok(res, websites);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ export async function deleteAccount(userId) {
|
|||||||
}),
|
}),
|
||||||
])
|
])
|
||||||
.then(async res => {
|
.then(async res => {
|
||||||
if (redis.client) {
|
if (redis.enabled) {
|
||||||
for (let i = 0; i < websiteUuids.length; i++) {
|
for (let i = 0; i < websiteUuids.length; i++) {
|
||||||
await redis.set(`website:${websiteUuids[i]}`, DELETED);
|
await redis.set(`website:${websiteUuids[i]}`, DELETED);
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,8 @@ export async function createWebsite(userId, data) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(async res => {
|
.then(async res => {
|
||||||
if (redis.client && res) {
|
if (redis.enabled && res) {
|
||||||
await redis.client.set(`website:${res.websiteUuid}`, res.id);
|
await redis.set(`website:${res.websiteUuid}`, res.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -21,8 +21,8 @@ export async function deleteWebsite(websiteUuid) {
|
|||||||
where: { websiteUuid },
|
where: { websiteUuid },
|
||||||
}),
|
}),
|
||||||
]).then(async res => {
|
]).then(async res => {
|
||||||
if (redis.client) {
|
if (redis.enabled) {
|
||||||
await redis.client.set(`website:${websiteUuid}`, DELETED);
|
await redis.set(`website:${websiteUuid}`, DELETED);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -8,7 +8,7 @@ export async function getWebsite(where) {
|
|||||||
})
|
})
|
||||||
.then(async data => {
|
.then(async data => {
|
||||||
if (redis.enabled && data) {
|
if (redis.enabled && data) {
|
||||||
await redis.client.set(`website:${data.websiteUuid}`, data.id);
|
await redis.set(`website:${data.websiteUuid}`, data.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
@ -30,8 +30,8 @@ async function relationalQuery(websiteId, data) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(async res => {
|
.then(async res => {
|
||||||
if (redis.client && res) {
|
if (redis.enabled && res) {
|
||||||
await redis.client.set(`session:${res.sessionUuid}`, 1);
|
await redis.set(`session:${res.sessionUuid}`, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@ -59,7 +59,7 @@ async function clickhouseQuery(
|
|||||||
|
|
||||||
await sendMessage(params, 'event');
|
await sendMessage(params, 'event');
|
||||||
|
|
||||||
if (redis.client) {
|
if (redis.enabled) {
|
||||||
await redis.client.set(`session:${sessionUuid}`, 1);
|
await redis.set(`session:${sessionUuid}`, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ async function relationalQuery(sessionUuid) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(async res => {
|
.then(async res => {
|
||||||
if (redis.client && res) {
|
if (redis.enabled && res) {
|
||||||
await redis.client.set(`session:${res.sessionUuid}`, 1);
|
await redis.set(`session:${res.sessionUuid}`, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@ -48,8 +48,8 @@ async function clickhouseQuery(sessionUuid) {
|
|||||||
)
|
)
|
||||||
.then(result => findFirst(result))
|
.then(result => findFirst(result))
|
||||||
.then(async res => {
|
.then(async res => {
|
||||||
if (redis.client && res) {
|
if (redis.enabled && res) {
|
||||||
await redis.client.set(`session:${res.session_uuid}`, 1);
|
await redis.set(`session:${res.session_uuid}`, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
Loading…
Reference in New Issue
Block a user