feat: stats saving #490
@ -1,5 +1,5 @@
 | 
				
			|||||||
import { Schema, model } from "mongoose";
 | 
					import { Schema, model } from "mongoose";
 | 
				
			||||||
import { IEnemy, IMission, IScan, ITutorial, IAbility, IWeapon, IStatsView } from "@/src/types/statTypes";
 | 
					import { IEnemy, IMission, IScan, ITutorial, IAbility, IWeapon, IStatsDatabase } from "@/src/types/statTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const abilitySchema = new Schema<IAbility>(
 | 
					const abilitySchema = new Schema<IAbility>(
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -58,7 +58,7 @@ const weaponSchema = new Schema<IWeapon>(
 | 
				
			|||||||
    { _id: false }
 | 
					    { _id: false }
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const statsSchema = new Schema<IStatsView>({
 | 
					const statsSchema = new Schema<IStatsDatabase>({
 | 
				
			||||||
    accountOwnerId: Schema.Types.ObjectId,
 | 
					    accountOwnerId: Schema.Types.ObjectId,
 | 
				
			||||||
    CiphersSolved: Number,
 | 
					    CiphersSolved: Number,
 | 
				
			||||||
    CiphersFailed: Number,
 | 
					    CiphersFailed: Number,
 | 
				
			||||||
@ -84,6 +84,6 @@ const statsSchema = new Schema<IStatsView>({
 | 
				
			|||||||
    ReviveCount: Number
 | 
					    ReviveCount: Number
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const Stats = model<IStatsView>("Stats", statsSchema);
 | 
					const Stats = model<IStatsDatabase>("Stats", statsSchema);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default Stats;
 | 
					export default Stats;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user