mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-23 18:56:12 +01:00
* feat: Add persistable property to banners and update related components * refactor: Clean up Banner component and improve className handling
48 lines
848 B
TypeScript
48 lines
848 B
TypeScript
import { Schema, Document } from 'mongoose';
|
|
|
|
export interface IBanner extends Document {
|
|
bannerId: string;
|
|
message: string;
|
|
displayFrom: Date;
|
|
displayTo?: Date;
|
|
type: 'banner' | 'popup';
|
|
isPublic: boolean;
|
|
persistable: boolean;
|
|
}
|
|
|
|
const bannerSchema = new Schema<IBanner>(
|
|
{
|
|
bannerId: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
message: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
displayFrom: {
|
|
type: Date,
|
|
required: true,
|
|
default: Date.now,
|
|
},
|
|
displayTo: {
|
|
type: Date,
|
|
},
|
|
type: {
|
|
type: String,
|
|
enum: ['banner', 'popup'],
|
|
default: 'banner',
|
|
},
|
|
isPublic: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
persistable: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
},
|
|
{ timestamps: true },
|
|
);
|
|
|
|
export default bannerSchema;
|