Fixing some errors due to changing reservation requests
This commit is contained in:
parent
3247ca5315
commit
c7d9bef9f0
1 changed files with 7 additions and 6 deletions
|
|
@ -1,14 +1,13 @@
|
|||
import dayjs from 'dayjs'
|
||||
import { v4 } from 'uuid'
|
||||
import { Logger, LogLevel } from './common/logger'
|
||||
import { ReservationRequest } from './common/request'
|
||||
import { Reservation } from './common/reservation'
|
||||
import { Runner } from './common/runner'
|
||||
|
||||
const run = async (request: ReservationRequest) => {
|
||||
const run = async (request: Record<string, any>) => {
|
||||
Logger.instantiate('local', v4(), LogLevel.DEBUG)
|
||||
const { username, password, dateRange, opponent } = request
|
||||
const reservation = new Reservation({ username, password }, dateRange, opponent)
|
||||
const { user, dateRange, opponent } = request
|
||||
const reservation = new Reservation(user, dateRange, opponent)
|
||||
|
||||
const runner = new Runner(username, password, [reservation])
|
||||
await runner.run({ headless: false })
|
||||
|
|
@ -40,8 +39,10 @@ const [startHour, startMinute] = startTime
|
|||
const [endHour, endMinute] = endTime.split(':').map((t) => Number.parseInt(t))
|
||||
|
||||
run({
|
||||
user: {
|
||||
username: username,
|
||||
password: password,
|
||||
},
|
||||
dateRange: {
|
||||
start: dayjs(`${year}-${month}-${day}T${startHour}:${startMinute}`),
|
||||
end: dayjs(`${year}-${month}-${day}T${endHour}:${endMinute}`),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue