Files
workavia-calendar-front/src/websocket/operations/registerToCalendars.ts
T
lethemanh cadfa70e60 #708 apply strictier linting rules (#717)
* #708 apply strictier linting rules and fix simple eslint bugs

* #708 fix eslint errors relate to promise

* #708 fix eslint import/no-extraneous-dependencies

* #708 fix eslint errors of react-hook

* #708 enable eslint check for typescript

---------

Co-authored-by: lethemanh <lethemanh@lethemanhs-MacBook-Pro.local>
2026-04-01 17:15:10 +02:00

17 lines
350 B
TypeScript

export function registerToCalendars(
socket: WebSocket,
calendarURIList: string[]
): void {
if (socket.readyState !== WebSocket.OPEN) {
throw new Error('Cannot register: WebSocket is not open')
}
socket.send(
JSON.stringify({
register: calendarURIList
})
)
console.info('Registered to calendars', calendarURIList)
}