mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: include complete stage name in command
This commit is contained in:
1 parent
8f22babe7d
commit
aec0cf84ad
6 files changed
+27
-7
No files matched your search
@@ -41,6 +41,11 @@ export async function newCommand(req, res) {
|
||||
|
||||
const response = await commandHandler.run()
|
||||
|
||||
if (response) {
|
||||
c.stage = response.stage
|
||||
await c.save()
|
||||
}
|
||||
|
||||
res.status(201).json(response)
|
||||
await session.save()
|
||||
}
|
||||
@@ -113,16 +113,14 @@ export default class CommandHandler extends SessionHandler {
|
||||
stages.map((stage) => this.isMatch(stage.condition))
|
||||
)
|
||||
|
||||
console.log('matches', matches)
|
||||
|
||||
const stage = stages.find((_, i) => matches[i])
|
||||
console.log('stage', stage)
|
||||
if (!stage) {
|
||||
return {}
|
||||
}
|
||||
const response = this.execute(stage)
|
||||
|
||||
return {
|
||||
stage: stage.id,
|
||||
end: this.session.status === 'finished',
|
||||
...response,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user