Revert "Add Locale URL"

This reverts commit d910b21185.
This commit is contained in:
Restray
2022-04-02 19:29:22 +02:00
parent 92d1f5aa55
commit 943300509b
187 changed files with 539 additions and 690 deletions

View File

@@ -0,0 +1,25 @@
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);
}
};