mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
* feat: Add banner schema and model * feat: Add optional JwtAuth To handle the conditional logic with and without authentication within the model. * feat: Add an endpoint to retrieve a banner * feat: Add implementation for client to use banner and access API * feat: Display a banner on UI * feat: Script for updating and deleting banners * style: Update banner style * fix: Adjust the height when the banner is displayed * fix: failed specs
36 lines
620 B
JavaScript
36 lines
620 B
JavaScript
const mongoose = require('mongoose');
|
|
|
|
const bannerSchema = mongoose.Schema(
|
|
{
|
|
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,
|
|
},
|
|
},
|
|
|
|
{ timestamps: true },
|
|
);
|
|
|
|
const Banner = mongoose.model('Banner', bannerSchema);
|
|
module.exports = Banner;
|