Added expose port for Services

This commit is contained in:
Aaron Styles
2022-04-30 22:47:00 +10:00
parent 40cbee0d75
commit f94e17134e
30 changed files with 153 additions and 36 deletions

View File

@@ -11,14 +11,16 @@ export const post: RequestHandler = async (event) => {
let {
name,
fqdn,
exposePort,
plausibleAnalytics: { email, username }
} = await event.request.json();
if (fqdn) fqdn = fqdn.toLowerCase();
if (email) email = email.toLowerCase();
if (exposePort) exposePort = Number(exposePort);
try {
await db.updatePlausibleAnalyticsService({ id, fqdn, name, email, username });
await db.updatePlausibleAnalyticsService({ id, fqdn, name, email, username, exposePort });
return { status: 201 };
} catch (error) {
return ErrorHandler(error);