adds eslint

This commit is contained in:
geoffsee
2025-06-24 17:29:52 -04:00
committed by Geoff Seemueller
parent 9698fc6f3b
commit 02c3253343
169 changed files with 4896 additions and 4804 deletions

View File

@@ -1,14 +1,15 @@
// ContactService.ts
import { types, flow, getSnapshot } from "mobx-state-tree";
import ContactRecord from "../models/ContactRecord.ts";
import { types, flow, getSnapshot } from 'mobx-state-tree';
import ContactRecord from '../models/ContactRecord.ts';
export default types
.model("ContactStore", {})
.volatile((self) => ({
.model('ContactStore', {})
.volatile(self => ({
env: {} as Env,
ctx: {} as ExecutionContext,
}))
.actions((self) => ({
.actions(self => ({
setEnv(env: Env) {
self.env = env;
},
@@ -17,12 +18,7 @@ export default types
},
handleContact: flow(function* (request: Request) {
try {
const {
markdown: message,
email,
firstname,
lastname,
} = yield request.json();
const { markdown: message, email, firstname, lastname } = yield request.json();
const contactRecord = ContactRecord.create({
message,
timestamp: new Date().toISOString(),
@@ -37,19 +33,19 @@ export default types
);
yield self.env.EMAIL_SERVICE.sendMail({
to: "geoff@seemueller.io",
to: 'geoff@seemueller.io',
plaintextMessage: `WEBSITE CONTACT FORM SUBMISSION
${firstname} ${lastname}
${email}
${message}`,
});
return new Response("Contact record saved successfully", {
return new Response('Contact record saved successfully', {
status: 200,
});
} catch (error) {
console.error("Error processing contact request:", error);
return new Response("Failed to process contact request", {
console.error('Error processing contact request:', error);
return new Response('Failed to process contact request', {
status: 500,
});
}