youtuber-blog-frontend/build/server/chunks/9-Bvo3cAjV.js
2024-06-22 01:07:29 +02:00

60 lines
1.8 KiB
JavaScript

import { c as config } from './config-BHx687w1.js';
import './index-Ddp2AB5f.js';
import './stores-q_3MsRzq.js';
import './index-DFEd82Gl.js';
import { s as superValidate, z as zod, f as fail } from './zod-B9q4bgLb.js';
import { f as formSchema } from './schema-BQhPA6Gl.js';
import './shared-server-i79vVjEm.js';
import './lifecycle-Cykl3Eqn.js';
import './exports-DuWZopOC.js';
import './index2-BO_DJNQw.js';
import './stringify-D5iWhcfN.js';
import './scheduler-e11T_xkt.js';
import 'zod';
const actions = {
default: async (event) => {
const form = await superValidate(event, zod(formSchema));
if (!form.valid) {
return fail(400, {
form
});
}
await event.fetch(config.api_url + "/blog/signup", {
method: "POST",
body: JSON.stringify({
email: form.data.email,
site_id: event.params.site_id,
source: extractSlug(form.data.source)
}),
headers: {
"content-type": "application/json"
}
});
return {
form
};
}
};
function extractSlug(url) {
const path = new URL(url).pathname;
const parts = path.split("/").filter((x) => x);
return parts[3];
}
var _page_server = /*#__PURE__*/Object.freeze({
__proto__: null,
actions: actions
});
const index = 9;
let component_cache;
const component = async () => component_cache ??= (await import('./_page.svelte-BDSxC-dW.js')).default;
const server_id = "src/routes/site/[site_id]/+page.server.js";
const imports = ["_app/immutable/nodes/9.DQLKyvs_.js","_app/immutable/chunks/scheduler.BsMbz5U8.js","_app/immutable/chunks/each.jOEBnCSj.js","_app/immutable/chunks/index.rkWRBFIu.js"];
const stylesheets = [];
const fonts = [];
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
//# sourceMappingURL=9-Bvo3cAjV.js.map