-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathref
More file actions
62 lines (50 loc) · 1.67 KB
/
ref
File metadata and controls
62 lines (50 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// npx prisma migrate dev --name init
// "use client";
// import { useEffect } from 'react';
// import { useProjectStore } from '@/app/store/useProjectStore';
// import { format } from 'date-fns';
// function ProjectList() {
// const { projects, fetchProjects } = useProjectStore();
// useEffect(() => {
// fetchProjects();
// }, [fetchProjects]);
// return (
// <div>
// {projects.map((project) => (
// <div key={project.id}>
// <h3>{project.projectName}</h3>
// <p>{format(new Date(project.date), 'dd MMM HH:mm')}</p>
// </div>
// ))}
// </div>
// );
// }
// export default ProjectList;
//Email verifacion code=============================================
// const verificationCode = Math.floor(
// 100000 + Math.random() * 900000
// ).toString();
// const expiry = new Date(Date.now() + 10 * 60 * 1000);
// await db.verificationCode.upsert({
// where: { userId: user.id },
// update: { code: verificationCode, expiresAt: expiry },
// create: { userId: user.id, code: verificationCode, expiresAt: expiry },
// });
// // Render the email template as a string
// const emailHtml = `
// <div>
// <h2>Verify Your Email</h2>
// <p>Hello ${user.username || "User"}, use this code: ${verificationCode}</p>
// </div>
// `;
// // Send the email
// const { data, error } = await resend.emails.send({
// from: "ProTrack <no-reply@protrack.com>",
// to: email,
// subject: "Your ProTrack Verification Code",
// html: emailHtml,
// });
// if (error) {
// console.log(error)
// return NextResponse.json({ message: "Failed to send email", error });
// }