More TypeScript :)
This commit is contained in:
@@ -7,11 +7,11 @@ async function connectToDatabase() {
|
||||
return client
|
||||
}
|
||||
|
||||
async function fetchLatestPatch(client) {
|
||||
async function fetchLatestPatch(client : MongoClient) {
|
||||
const database = client.db("patches");
|
||||
const patches = database.collection("patches");
|
||||
const latestPatch = await patches.find().limit(1).sort({date:-1}).next()
|
||||
return latestPatch.patch
|
||||
return latestPatch!!.patch as string
|
||||
}
|
||||
|
||||
export {connectToDatabase, fetchLatestPatch}
|
||||
Reference in New Issue
Block a user