mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: send response to frontend
This commit is contained in:
1 parent
fb69cb4e10
commit
88ee8f2cc3
8 files changed
+46
-35
No files matched your search
@@ -51,16 +51,16 @@ export const newCommand = asyncHandler(async (req: Request, res: Response) => {
|
||||
c.stage = response.stage
|
||||
await c.save()
|
||||
|
||||
session.responses.push(response.responses)
|
||||
|
||||
if (response.stage === 'END') {
|
||||
await finishSession(session)
|
||||
}
|
||||
commandCompleteCallbacks.set(session.id, response.callback)
|
||||
pushToSession(session.id, 'status', 'pending')
|
||||
res.status(201).json(response)
|
||||
} else {
|
||||
res.status(200).end()
|
||||
// commandCompleteCallbacks.set(session.id, response.callback)
|
||||
pushToSession(session.id, 'response', response)
|
||||
}
|
||||
|
||||
res.status(200).end()
|
||||
await session.save()
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user