2024-05-04 16:12:00 +02:00
|
|
|
import { IGuild } from "@/src/types/guildTypes";
|
2024-05-04 15:42:25 +02:00
|
|
|
import { model, Schema } from "mongoose";
|
|
|
|
import { toOid } from "@/src/helpers/inventoryHelpers";
|
|
|
|
|
|
|
|
const guildSchema = new Schema<IGuild>({
|
|
|
|
Name: { type: String, required: true }
|
|
|
|
});
|
|
|
|
|
|
|
|
guildSchema.set("toJSON", {
|
|
|
|
virtuals: true,
|
|
|
|
transform(_document, guild) {
|
|
|
|
guild._id = toOid(guild._id);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export const Guild = model<IGuild>("Guild", guildSchema);
|