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