summaryrefslogtreecommitdiff
path: root/src/api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api.ts')
-rw-r--r--src/api.ts12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/api.ts b/src/api.ts
index 678f40d..6132882 100644
--- a/src/api.ts
+++ b/src/api.ts
@@ -1,4 +1,3 @@
-import { parse } from "./duration";
import { perform } from "./email";
import type { EmailJob } from "./job";
import { ConsoleLogger } from "./logger";
@@ -11,16 +10,7 @@ export const main = (port: number) => {
const url = new URL(req.url);
if (req.method === "POST" && url.pathname === "/api/email") {
- const prevalidatedJob = await req.json();
- const interval = parse(prevalidatedJob.readRetry.interval);
- if (interval._tag === "Left") {
- return new Response(interval.left, { status: 400 });
- }
- prevalidatedJob.readRetry.interval = interval;
- const job: EmailJob = {
- ...prevalidatedJob,
- readRetry: { ...prevalidatedJob.readRetry, interval },
- };
+ const job: EmailJob = await req.json();
const jobInsensitive = structuredClone(job);
jobInsensitive.from.username = "****REDACTED****";