remove insert segment if segment does not exist

This commit is contained in:
edmondlang
2022-04-21 01:12:32 +08:00
parent 98dc43d23a
commit edb644eaeb
@@ -96,16 +96,7 @@ class UpdateConstantLogic extends AbstractControllerLogic
*/
public function logic(Request $request) : JsonResponse
{
try {
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
} catch (ResourceNotFoundException $exception){
$object = new SegmentObject('Standard Segment', 1);
$segment = $this->createsSegment->execute($object);
}
$segment = $this->fetchesSegment->execute(['id' => $request->route('id')]);
try {