Skip to content

Commit 21c26e5

Browse files
authored
Merge pull request #2 from vanloctech/1.0.1
mapping old arguments for validate
2 parents a840269 + 40093f8 commit 21c26e5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Commands/TelehookCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public function handle()
174174
}
175175

176176
try {
177+
$this->mappingArguments();
177178
$argumentName = $this->conversation->next_argument_name;
178179
$this->$argumentName = new TelehookArgument([
179180
'name' => $argumentName,
@@ -347,6 +348,13 @@ protected function getMetadataByMessageTypeText(): array
347348
* @return void
348349
*/
349350
protected function finishing()
351+
{
352+
$this->mappingArguments();
353+
354+
$this->conversation->update(['status' => TelehookConversation::STATUS_FINISH]);
355+
}
356+
357+
public function mappingArguments()
350358
{
351359
$details = $this->conversation->detailsHasArgumentName;
352360

@@ -355,8 +363,6 @@ protected function finishing()
355363
$metadata = json_decode($item->metadata ?? '{}', true);
356364
$this->$argName = new TelehookArgument($metadata);
357365
}
358-
359-
$this->conversation->update(['status' => TelehookConversation::STATUS_FINISH]);
360366
}
361367

362368
/**

0 commit comments

Comments
 (0)