(uid: string)
| 79 | } |
| 80 | |
| 81 | export async function getLastResultTimestamp(uid: string): Promise<number> { |
| 82 | const lastResult = await getResultCollection().findOne( |
| 83 | { uid }, |
| 84 | { |
| 85 | projection: { timestamp: 1, _id: 0 }, |
| 86 | sort: { timestamp: -1 }, |
| 87 | }, |
| 88 | ); |
| 89 | |
| 90 | if (lastResult === null) throw new MonkeyError(404, "No last result found"); |
| 91 | return lastResult.timestamp; |
| 92 | } |
| 93 | |
| 94 | export async function getResultByTimestamp( |
| 95 | uid: string, |
nothing calls this directly
no test coverage detected