feat: lint codebase and run precommit hook

This commit is contained in:
Rotimi Best
2025-12-25 09:01:51 +00:00
parent 334c67f22a
commit b31ccf3037
214 changed files with 6191 additions and 2880 deletions
+1 -3
View File
@@ -17,9 +17,7 @@ async function getBlogPosts() {
}
}
blogPosts = blogPosts.sort(
(first, second) => new Date(second.date).getTime() - new Date(first.date).getTime()
);
blogPosts = blogPosts.sort((first, second) => new Date(second.date).getTime() - new Date(first.date).getTime());
return blogPosts;
}
+25 -26
View File
@@ -1,33 +1,32 @@
import { PUBLIC_SERVER_URL } from '$env/static/public';
const sendEmail =
(sFetch: typeof fetch) => async (subject: string, content: string, replyTo?: string) => {
try {
const response = await sFetch(`${PUBLIC_SERVER_URL}/sendEmail`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify([
{
from: `"ClassroomIO Support" <notify@mail.classroomio.com>`,
to: 'help@classroomio.com',
subject,
content,
replyTo
}
])
});
const sendEmail = (sFetch: typeof fetch) => async (subject: string, content: string, replyTo?: string) => {
try {
const response = await sFetch(`${PUBLIC_SERVER_URL}/sendEmail`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify([
{
from: `"ClassroomIO Support" <notify@mail.classroomio.com>`,
to: 'help@classroomio.com',
subject,
content,
replyTo
}
])
});
const responseData = await response.json();
console.log('Emails sent successfully:', responseData);
const responseData = await response.json();
console.log('Emails sent successfully:', responseData);
return 'sent';
} catch (error) {
console.error('Error sending email', error);
return 'failed';
}
};
return 'sent';
} catch (error) {
console.error('Error sending email', error);
return 'failed';
}
};
export async function POST({ request, fetch }) {
try {