Skip to content

Commit 892cc72

Browse files
committed
WIP: Fixing email sending with new editor
1 parent 8383821 commit 892cc72

8 files changed

Lines changed: 568 additions & 629 deletions

File tree

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
11
import mongoose from "mongoose";
2-
import { Email, Constants } from "@courselit/common-models";
3-
import { EmailContentSchema } from "@courselit/common-logic";
2+
import { EmailSchema } from "@courselit/common-logic";
43

5-
const EmailSchema = new mongoose.Schema<Email>({
6-
emailId: { type: String, required: true },
7-
content: { type: EmailContentSchema, required: true },
8-
subject: { type: String, required: true },
9-
delayInMillis: { type: Number, required: true, default: 86400000 },
10-
published: { type: Boolean, required: true, default: false },
11-
action: new mongoose.Schema({
12-
type: {
13-
type: String,
14-
enum: Constants.emailActionTypes,
15-
},
16-
data: { type: mongoose.Schema.Types.Mixed },
17-
}),
18-
});
19-
20-
export default EmailSchema;
4+
export default mongoose.models.Email || mongoose.model("Email", EmailSchema);

0 commit comments

Comments
 (0)