Files
librechat.ai/utils/Subscriber.ts
Danny Avila 15a0eee00c 📅 feat: Add 2025 Roadmap Blog Post (#242)
* 📅 feat: Add 2025 roadmap blog post with upcoming features and partnerships

* 🔨 refactor: Migrate Subscriber model to TypeScript and update API handler for type safety

* chore: remove comment

* fix: build issues with numeric blog tag

* chore: update discussion links in 2025 roadmap blog post
2025-02-20 14:43:12 -05:00

25 lines
494 B
TypeScript

import mongoose, { Schema, Model, Document } from 'mongoose'
interface ISubscriber extends Document {
email: string
status: string
}
const SubscriberSchema = new Schema({
email: {
type: String,
lowercase: true,
required: true,
unique: true,
},
status: {
type: String,
default: 'subscribed',
},
})
const Subscriber: Model<ISubscriber> =
mongoose.models.Subscriber || mongoose.model<ISubscriber>('Subscriber', SubscriberSchema)
export default Subscriber