feat: more work on clans #214
@ -2,14 +2,18 @@ import { IGuild } from "@/src/types/guildTypes";
 | 
			
		||||
import { model, Schema } from "mongoose";
 | 
			
		||||
import { toOid } from "@/src/helpers/inventoryHelpers";
 | 
			
		||||
 | 
			
		||||
const guildSchema = new Schema<IGuild>({
 | 
			
		||||
    Name: { type: String, required: true }
 | 
			
		||||
});
 | 
			
		||||
const guildSchema = new Schema<IGuild>(
 | 
			
		||||
    {
 | 
			
		||||
        Name: { type: String, required: true }
 | 
			
		||||
    },
 | 
			
		||||
    { id: false }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
guildSchema.set("toJSON", {
 | 
			
		||||
    virtuals: true,
 | 
			
		||||
    transform(_document, guild) {
 | 
			
		||||
        guild._id = toOid(guild._id);
 | 
			
		||||
        delete guild.__v;
 | 
			
		||||
    }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user