1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-02 16:39:29 +00:00

Added class stat data, and amended pluralisation logic

This commit is contained in:
2022-03-06 20:36:21 +00:00
parent fcd37ed1fd
commit e94f8ef94c
2 changed files with 18 additions and 12 deletions

View File

@@ -26,17 +26,18 @@ router.get('/dashboard', async (req, res) => {
stats: [
{
value: classes.length,
text: 'Class' + (classes.length > 1 ? 'es' : '')
text: 'Class' +
(classes.length !== 1 ? 'es' : '')
},
{
value: recentTests.length,
text: 'Completed Test' +
(recentTests.length > 1 ? 's' : '')
(recentTests.length !== 1 ? 's' : '')
},
{
value: upcomingTests.length,
text: 'Upcoming Test' +
(upcomingTests.length > 1 ? 's' : '')
(upcomingTests.length !== 1 ? 's' : '')
},
{
value: '90%',