2023-10-03 01:22:43 -04:00
|
|
|
import mongoose, { Schema, PopulatedDoc, Document, Model } from "mongoose";
|
2023-09-25 19:50:50 -04:00
|
|
|
|
|
|
|
export enum Color {
|
|
|
|
"orange" = "orange",
|
|
|
|
"yellow" = "yellow",
|
|
|
|
"green" = "green",
|
|
|
|
"turquoise" = "turquoise",
|
|
|
|
"cyan" = "cyan",
|
|
|
|
"blue" = "blue",
|
|
|
|
"purple" = "purple",
|
|
|
|
"red" = "red",
|
2023-10-03 01:22:43 -04:00
|
|
|
"pink" = "pink",
|
2023-09-25 19:50:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ISidebarItem {
|
2023-10-05 02:05:12 -04:00
|
|
|
color: Color | string;
|
2023-10-03 01:22:43 -04:00
|
|
|
url: string;
|
|
|
|
linkTitle: string;
|
2023-09-25 19:50:50 -04:00
|
|
|
index: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
const SISchema = new mongoose.Schema<ISidebarItem>({
|
|
|
|
color: {
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
url: {
|
2023-10-03 01:22:43 -04:00
|
|
|
type: String,
|
2023-09-25 19:50:50 -04:00
|
|
|
},
|
|
|
|
linkTitle: {
|
2023-10-03 01:22:43 -04:00
|
|
|
type: String,
|
2023-09-25 19:50:50 -04:00
|
|
|
},
|
|
|
|
index: {
|
2023-10-03 01:22:43 -04:00
|
|
|
type: Number,
|
|
|
|
},
|
|
|
|
});
|
2023-09-25 19:50:50 -04:00
|
|
|
|
2023-10-03 01:22:43 -04:00
|
|
|
export const SidebarItem: Model<ISidebarItem> =
|
|
|
|
/* mongoose.models.SidebarItem || */ mongoose.model(
|
|
|
|
"SidebarItem",
|
|
|
|
SISchema,
|
|
|
|
"sidebar",
|
|
|
|
);
|