@@ -10,39 +10,38 @@ export default class TransmitProvider {
1010 } )
1111 }
1212
13- boot ( ) {
14- this . app . container . resolving ( 'router' , async ( router ) => {
15- const transmit = await this . app . container . make ( 'transmit' )
13+ async boot ( ) {
14+ const router = await this . app . container . make ( 'router' )
15+ const transmit = await this . app . container . make ( 'transmit' )
1616
17- router . get ( '__transmit/events' , ( { request, response } ) => {
18- transmit . createStream ( request , response )
19- } )
17+ router . get ( '__transmit/events' , ( { request, response } ) => {
18+ transmit . createStream ( request , response )
19+ } )
2020
21- router . post ( '__transmit/subscribe' , ( ctx ) => {
22- const uid = ctx . request . input ( 'uid' )
23- const channel = ctx . request . input ( 'channel' )
21+ router . post ( '__transmit/subscribe' , ( ctx ) => {
22+ const uid = ctx . request . input ( 'uid' )
23+ const channel = ctx . request . input ( 'channel' )
2424
25- const success = transmit . subscribeToChannel ( uid , channel , ctx )
25+ const success = transmit . subscribeToChannel ( uid , channel , ctx )
2626
27- if ( ! success ) {
28- return ctx . response . badRequest ( )
29- }
27+ if ( ! success ) {
28+ return ctx . response . badRequest ( )
29+ }
3030
31- return ctx . response . noContent ( )
32- } )
31+ return ctx . response . noContent ( )
32+ } )
3333
34- router . post ( '__transmit/unsubscribe' , ( { request, response } ) => {
35- const uid = request . input ( 'uid' )
36- const channel = request . input ( 'channel' )
34+ router . post ( '__transmit/unsubscribe' , ( { request, response } ) => {
35+ const uid = request . input ( 'uid' )
36+ const channel = request . input ( 'channel' )
3737
38- const success = transmit . unsubscribeFromChannel ( uid , channel )
38+ const success = transmit . unsubscribeFromChannel ( uid , channel )
3939
40- if ( ! success ) {
41- return response . badRequest ( )
42- }
40+ if ( ! success ) {
41+ return response . badRequest ( )
42+ }
4343
44- return response . noContent ( )
45- } )
44+ return response . noContent ( )
4645 } )
4746 }
4847}
0 commit comments