-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fixed one migration problem and null level handling in getLevel() & getPoints(), causing some error #59
Conversation
The $table->timestamp(column: 'ended_at') shouldbe $table->timestamp(column: 'ended_at')->nullable()
…tLevel() & getPoints(), public function getPoints(): int { return $this->experience->experience_points ; } public function getLevel(): int { return $this->experience->status->level ; } to public function getPoints(): int { return $this->experience->experience_points ?? 0; } public function getLevel(): int { return $this->experience->status->level ?? 0; }
Thanks for the PR @joydeep-bhowmik Could you write a test for point 1, just to make sure it is doing what it is supposed to do? And the Linter is failing on GA, so can you make sure Thanks. |
I will add it as soon as possible ... too much work load this week :( |
Warning This will need an update in the UPGRADE.md explaining that a new Migration needs creating to make the |
unable to pass Linter test |
Yeah don't worry about it, I dunno what is up with it |
The code in `GiveExperience.php` has been refactored for improved readability and consistency. In particular, changes were made to the syntax of `if` statements and the space around the NOT operator was adjusted. The `UPGRADE.md` documentation was also updated, with versions and migration details rearranged for clearer understanding.
Thanks for the work on this @joydeep-bhowmik. Appreciate it! |
Description
1st Issue
When there is no experience record yet and
getPoints()
is executed, it returns the following error message:This issue was addressed by modifying two functions as follows:
2nd Issue
During migration, the following SQL error was encountered:
This issue was resolved by adding a nullable constraint to the
ended_at
column in the migration script:Type of Change
Related Issues