All checks were successful
CI / update (push) Successful in 1m21s
- Add RosaryStreak MongoDB model for logged-in users - Add /api/glaube/rosary-streak GET/POST endpoints - Sync streak to server when logged in, merge local/server data - Auto-sync when coming back online (PWA offline support) - Falls back to localStorage for guests
13 lines
430 B
TypeScript
13 lines
430 B
TypeScript
import mongoose from 'mongoose';
|
|
|
|
const RosaryStreakSchema = new mongoose.Schema(
|
|
{
|
|
username: { type: String, required: true, unique: true },
|
|
length: { type: Number, required: true, default: 0 },
|
|
lastPrayed: { type: String, default: null } // ISO date string (YYYY-MM-DD)
|
|
},
|
|
{ timestamps: true }
|
|
);
|
|
|
|
export const RosaryStreak = mongoose.models.RosaryStreak || mongoose.model("RosaryStreak", RosaryStreakSchema);
|