mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
21 lines
457 B
JavaScript
21 lines
457 B
JavaScript
/* eslint-disable object-shorthand */
|
|
/* eslint-disable func-names */
|
|
import { UserProfile } from '@linux-odyssey/models'
|
|
|
|
export function questCount() {
|
|
return UserProfile.find().count()
|
|
}
|
|
|
|
export function questCompleted() {
|
|
return UserProfile.find({
|
|
$where: function () {
|
|
for (const key in this.progress) {
|
|
if (this.progress[key].completed === true) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
},
|
|
}).count()
|
|
}
|