Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Feb 2, 2024
1 parent a00bc5a commit 82c9c8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/MainMenuWidgets/LocationPicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function onLoadForm()

return $this->makePartial('formwidgets/recordeditor/form', [
'formRecordId' => $recordId,
'showDeleteButton' => $model->exists,
'formTitle' => lang($model->exists ? 'igniter.local::default.picker.text_edit_location' : 'igniter.local::default.picker.text_new_location'),
'formWidget' => $this->makeLocationFormWidget($model),
]);
Expand Down Expand Up @@ -122,11 +123,11 @@ public function onDeleteRecord()
new FlashException(lang('igniter.local::default.picker.alert_user_restricted'))
);

$model = $this->findFormModel(post('recordId'));
$model = $this->findFormModel((string)post('recordId'));

$model->delete();

flash()->success(sprintf(lang('igniter::admin.alert_success'), lang($this->formName).' deleted'))->now();
flash()->success(sprintf(lang('igniter::admin.alert_success'), lang('igniter.local::default.picker.text_form_name').' deleted'))->now();

return $this->reload();
}
Expand Down

0 comments on commit 82c9c8b

Please sign in to comment.