mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e8dda3952c
@ -147,6 +147,8 @@ export const EVENT_COLORS = [
|
|||||||
export const DOMAIN_REGEX =
|
export const DOMAIN_REGEX =
|
||||||
/^(localhost(:[1-9]\d{0,4})?|((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63})$/;
|
/^(localhost(:[1-9]\d{0,4})?|((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63})$/;
|
||||||
|
|
||||||
|
export const SHARE_ID_REGEX = /^[a-zA-Z0-9]{16}$/;
|
||||||
|
|
||||||
export const DESKTOP_SCREEN_WIDTH = 1920;
|
export const DESKTOP_SCREEN_WIDTH = 1920;
|
||||||
export const LAPTOP_SCREEN_WIDTH = 1024;
|
export const LAPTOP_SCREEN_WIDTH = 1024;
|
||||||
export const MOBILE_SCREEN_WIDTH = 479;
|
export const MOBILE_SCREEN_WIDTH = 479;
|
||||||
|
@ -63,6 +63,7 @@ export async function findSession(req: NextApiRequestCollect) {
|
|||||||
subdivision1,
|
subdivision1,
|
||||||
subdivision2,
|
subdivision2,
|
||||||
city,
|
city,
|
||||||
|
ownerId: website.userId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import { Website, NextApiRequestQueryBody } from 'lib/types';
|
|||||||
import { canViewWebsite, canUpdateWebsite, canDeleteWebsite } from 'lib/auth';
|
import { canViewWebsite, canUpdateWebsite, canDeleteWebsite } from 'lib/auth';
|
||||||
import { useAuth, useCors } from 'lib/middleware';
|
import { useAuth, useCors } from 'lib/middleware';
|
||||||
import { deleteWebsite, getWebsite, updateWebsite } from 'queries';
|
import { deleteWebsite, getWebsite, updateWebsite } from 'queries';
|
||||||
|
import { SHARE_ID_REGEX } from 'lib/constants';
|
||||||
|
|
||||||
export interface WebsiteRequestQuery {
|
export interface WebsiteRequestQuery {
|
||||||
id: string;
|
id: string;
|
||||||
@ -43,6 +44,10 @@ export default async (
|
|||||||
|
|
||||||
let website;
|
let website;
|
||||||
|
|
||||||
|
if (shareId && !shareId.match(SHARE_ID_REGEX)) {
|
||||||
|
return serverError(res, 'Invalid share ID.');
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
website = await updateWebsite(websiteId, { name, domain, shareId });
|
website = await updateWebsite(websiteId, { name, domain, shareId });
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
Loading…
Reference in New Issue
Block a user