2021-10-16 19:11:16 +02:00
|
|
|
import Player from '../../../schemas/Player.js'
|
2021-10-16 19:58:00 +02:00
|
|
|
import { connectMongoose } from './mongoForWorkes.js'
|
2021-10-16 19:11:16 +02:00
|
|
|
|
2021-10-16 19:58:00 +02:00
|
|
|
connectMongoose()
|
2021-10-16 19:11:16 +02:00
|
|
|
|
|
|
|
export function main(data) {
|
|
|
|
return new Promise(
|
|
|
|
(resolve, reject) => {
|
|
|
|
Player.findOneAndUpdate(
|
|
|
|
{ name: data.name },
|
|
|
|
{ teamPoints: data.teamPoints }
|
|
|
|
).then(
|
|
|
|
() => resolve()
|
|
|
|
)
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|