Critical Stability & Performance fixes. Excessive Log Set button gone on QIuck Log screen
This commit is contained in:
@@ -13,12 +13,12 @@
|
||||
"@prisma/adapter-better-sqlite3": "^7.1.0",
|
||||
"@prisma/client": "^6.19.0",
|
||||
"@types/better-sqlite3": "^7.6.13",
|
||||
"bcryptjs": "*",
|
||||
"bcryptjs": "3.0.3",
|
||||
"better-sqlite3": "^12.5.0",
|
||||
"cors": "*",
|
||||
"dotenv": "*",
|
||||
"express": "*",
|
||||
"jsonwebtoken": "*",
|
||||
"cors": "2.8.5",
|
||||
"dotenv": "17.2.3",
|
||||
"express": "5.1.0",
|
||||
"jsonwebtoken": "9.0.2",
|
||||
"ts-node-dev": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -32,4 +32,4 @@
|
||||
"ts-node": "*",
|
||||
"typescript": "*"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -41,6 +41,32 @@ router.get('/', async (req: any, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Get last set for specific exercise
|
||||
router.get('/:id/last-set', async (req: any, res) => {
|
||||
try {
|
||||
const userId = req.user.userId;
|
||||
const exerciseId = req.params.id;
|
||||
|
||||
const lastSet = await prisma.workoutSet.findFirst({
|
||||
where: {
|
||||
exerciseId,
|
||||
session: { userId } // Ensure optimization by filtering sessions of the user
|
||||
},
|
||||
include: {
|
||||
session: true
|
||||
},
|
||||
orderBy: {
|
||||
timestamp: 'desc'
|
||||
}
|
||||
});
|
||||
|
||||
res.json({ success: true, set: lastSet });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
res.status(500).json({ error: 'Server error' });
|
||||
}
|
||||
});
|
||||
|
||||
// Create/Update exercise
|
||||
router.post('/', async (req: any, res) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user