Add Locale URL

This commit is contained in:
Restray
2022-04-02 16:15:00 +02:00
parent 741db1778b
commit d910b21185
187 changed files with 683 additions and 532 deletions

View File

@@ -1,25 +0,0 @@
import { asyncExecShell, getEngine, getUserDetails } from '$lib/common';
import * as db from '$lib/database';
import { ErrorHandler } from '$lib/database';
import type { RequestHandler } from '@sveltejs/kit';
export const post: RequestHandler = async (event) => {
const { status, body } = await getUserDetails(event);
if (status === 401) return { status, body };
const { id } = event.params;
let { fqdn } = await event.request.json();
if (fqdn) fqdn = fqdn.toLowerCase();
try {
const found = await db.isDomainConfigured({ id, fqdn });
return {
status: found ? 500 : 200,
body: {
error: found && `Domain ${fqdn.replace('www.', '')} is already used.`
}
};
} catch (error) {
return ErrorHandler(error);
}
};