Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 1 addition & 52 deletions packages/backend/models/user.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//schema for users: auth fields, study goals, schedule, hours, password hashing
//schema for users: auth fields, study goals, hours, password hashing
import mongoose from "mongoose";
import bcrypt from "bcryptjs";

Expand All @@ -10,52 +10,6 @@ function isPasswordHash(password) {
return typeof password === "string" && BCRYPT_HASH_PATTERN.test(password);
}

const dayNames = [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday",
"sunday",
];

//user's weekly availability, including days, start time, end time, and timezone
const scheduleSchema = new mongoose.Schema(
{
days: {
type: [
{
type: String,
enum: dayNames,
lowercase: true,
trim: true,
},
],
default: [],
},

startTime: {
type: String,
default: "",
trim: true,
},

endTime: {
type: String,
default: "",
trim: true,
},

timezone: {
type: String,
default: "UTC",
trim: true,
},
},
{ _id: false },
);

//user model fields, ensure password not present when returning data
const userSchema = new mongoose.Schema(
{
Expand Down Expand Up @@ -113,11 +67,6 @@ const userSchema = new mongoose.Schema(
min: [0, "goal cannot be negative"],
},

schedule: {
type: scheduleSchema,
default: () => ({}),
},

totalHours: {
type: Number,
default: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
href="https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&display=swap"
rel="stylesheet"
/>
<title>frontend</title>
<title>GOAT Timer</title>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Dashboard = () => {
} ${now.getDate()}`;

const weeklyGoal = user?.goal || 15;
const hoursStudied = user?.weeklyHours || 0;
const hoursStudied = user?.weeklyHours?.toFixed(3) || 0;
const progress =
weeklyGoal > 0 ? Math.round((hoursStudied / weeklyGoal) * 100) : 0;

Expand Down
141 changes: 0 additions & 141 deletions packages/frontend/src/components/Groups.css

This file was deleted.

108 changes: 0 additions & 108 deletions packages/frontend/src/components/Groups.jsx

This file was deleted.

Loading
Loading