@@ -15,6 +15,7 @@ export class ParticipantStore {
1515 params = { }
1616 visit = { }
1717 visitList = [ ]
18+ @observable routeToQueueTable = false
1819
1920 // Setters
2021 setParticipantsList = data => {
@@ -50,6 +51,9 @@ export class ParticipantStore {
5051 setVisitParticipantId = data => {
5152 this . visit . participant = data
5253 }
54+ setRouteToQueue = data => {
55+ this . routeToQueueTable = data
56+ }
5357
5458 // Getters
5559 getParticipantsList = ( ) => {
@@ -135,13 +139,9 @@ export class ParticipantStore {
135139 } )
136140
137141 updateVisit = flow ( function * ( ) {
138- const { ok } = yield api . updateVisits (
139- toJS ( this . visit . id ) ,
140- toJS ( this . participant )
141- )
142+ const { ok } = yield api . updateVisits ( toJS ( this . visit . id ) , toJS ( this . visit ) )
142143 if ( ok ) {
143144 this . setRouteToQueue ( true )
144- this . routeToQueueTable ( )
145145 } else {
146146 // TODO: Handle errors
147147 }
@@ -156,17 +156,6 @@ export class ParticipantStore {
156156 }
157157 } )
158158
159- getFrontDeskStuff = flow ( function * ( ) {
160- const { ok } = yield api . getFrontDeskEvent ( {
161- participant : this . participant . id ,
162- } )
163- if ( ok ) {
164- // TODO: Handle sucess
165- } else {
166- // TODO: Handle errors
167- }
168- } )
169-
170159 updateFrontEndDeskEvent = flow ( function * ( ) {
171160 const { ok } = yield api . patchFrontDeskEvent ( )
172161 if ( ok ) {
@@ -182,7 +171,7 @@ export class ParticipantStore {
182171 event_type : "ARRIVED" ,
183172 } )
184173 if ( ok ) {
185- // TODO: Handle sucess
174+ this . setRouteToQueue ( true )
186175 } else {
187176 // TODO: Handle errors
188177 }
0 commit comments