Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Admin / PirepController #1291

Merged
merged 4 commits into from
Aug 30, 2021
Merged

Fix Admin / PirepController #1291

merged 4 commits into from
Aug 30, 2021

Conversation

FatihKoz
Copy link
Contributor

$fares was an array but was being handled like a collection , which of course was causing problems while assigning a value to $fare->pirep_id and with the $fare->save() calls.

PR fixes both and Closes #1233 and #1244

@nabeelio
Copy link
Owner

Thanks... actually the right place to fix this is in PirepController in the Admin section in saveFares. It should do something like:

new PirepFare([
    'fare_id' => $fare->id,
    'count'   => 100,
]);

Matching the PirepController in the frontend

@nabeelio
Copy link
Owner

Nice find!

@FatihKoz
Copy link
Contributor Author

Thanks... actually the right place to fix this is in PirepController in the Admin section in saveFares. It should do something like:

new PirepFare([
    'fare_id' => $fare->id,
    'count'   => 100,
]);

Matching the PirepController in the frontend

It may be... Actually I just tracked the error, then followed it back two/three steps and to be honest did not thought on better solutions... It was done there before but not working, somehow you designed it to be there :) I just fixed.

@nabeelio
Copy link
Owner

Yep just fix it in the controller, then the service file changes can be undone.

@FatihKoz
Copy link
Contributor Author

So moving all that delete and re-save code back to admin controller and then leaving the service as it was before ?

No problem :)

Move the logic to controller as requested
Reverting back the service changes as requested
@FatihKoz
Copy link
Contributor Author

Ready as you wished.

@FatihKoz FatihKoz changed the title Fix FareService Fix Admin / PirepController Aug 28, 2021
@nabeelio nabeelio merged commit 57277c5 into nabeelio:dev Aug 30, 2021
@FatihKoz FatihKoz deleted the patch-4 branch August 31, 2021 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Admin : Save Pirep Button Generates Error | FareService (Bug Report)
2 participants