mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
refactor: remove unused functions
This commit is contained in:
1 parent
b0e12b2027
commit
b96bcb27ad
2 files changed
-24
No files matched your search
@@ -1,28 +1,5 @@
|
||||
import { Command, Session } from '@linux-odyssey/models'
|
||||
|
||||
export function sessionCount() {
|
||||
return Session.find().count()
|
||||
}
|
||||
|
||||
export function sessionCompleted() {
|
||||
return Session.find({ status: 'finished' }).count()
|
||||
}
|
||||
|
||||
export function averageTimeUsage() {
|
||||
return Session.aggregate([
|
||||
{
|
||||
$group: {
|
||||
_id: '$quest',
|
||||
average: {
|
||||
$avg: {
|
||||
$subtract: ['$finishedAt', '$createdAt'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
])
|
||||
}
|
||||
|
||||
function formatTime(time) {
|
||||
const seconds = Math.floor(time / 1000)
|
||||
const minutes = Math.floor(seconds / 60)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import mongoose from 'mongoose'
|
||||
import { Session, User } from '@linux-odyssey/models'
|
||||
|
||||
function loginMethods(user) {
|
||||
|
||||
Reference in new issue
Block a user