feat: stats saving #490

Closed
AMelonInsideLemon wants to merge 2 commits from AMelonInsideLemon/stats into main
Showing only changes of commit bc4b89a5da - Show all commits

View File

@ -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;