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

Refactor lastUpdated #2314

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Refactor lastUpdated #2314

wants to merge 1 commit into from

Conversation

Chartman123
Copy link
Collaborator

This commit refactors the form creation and update logic in the ApiController class. It removes the unnecessary setting of the created and lastUpdated timestamps in the Form entity, as these values are now automatically set in the FormMapper class. This improves code readability and reduces redundancy.

The changes also include updates to the FormMapper class, where the insert and update methods now automatically set the created and lastUpdated timestamps respectively.

@Chartman123 Chartman123 added php PHP related ticket 2. developing Work in progress technical debt Technical issue labels Sep 9, 2024
@Chartman123 Chartman123 added this to the 4.3 milestone Sep 9, 2024
@Chartman123 Chartman123 linked an issue Sep 9, 2024 that may be closed by this pull request
@Chartman123 Chartman123 changed the title Refactor form creation and update logic Refactor lastUpdated Sep 9, 2024
@Chartman123 Chartman123 force-pushed the chore/refactor-lastUpdated branch 5 times, most recently from f42bf8a to bedcc05 Compare September 11, 2024 20:59
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 21.62162% with 29 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@13b1f00). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2314   +/-   ##
=======================================
  Coverage        ?   36.15%           
  Complexity      ?     1014           
=======================================
  Files           ?       70           
  Lines           ?     3811           
  Branches        ?        0           
=======================================
  Hits            ?     1378           
  Misses          ?     2433           
  Partials        ?        0           

@Chartman123
Copy link
Collaborator Author

@susnux do you have any idea why I get an Error 500 as soon as I open the Forms app?

Type: Error
Code: 0
Message: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '512' frames
File: /srv/www/htdocs/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php
Line: 104

@Chartman123 Chartman123 force-pushed the chore/refactor-lastUpdated branch 2 times, most recently from 9aef8d5 to 2345d77 Compare September 13, 2024 22:29
@Chartman123 Chartman123 marked this pull request as ready for review September 13, 2024 23:04
@Chartman123 Chartman123 added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 13, 2024
@Chartman123
Copy link
Collaborator Author

@susnux I was able to resolve my issue (thanks to @come-nc)

This can now be reviewed. I currently needed a little hack in the ApiControllerTest to make them pass. (state and lastUpdated don't have the expected values in line 499. null instead of 0 and 0 instead of 123456789).

This commit refactors the form creation and update logic in the `ApiController` class. It removes the unnecessary setting of the `created` and `lastUpdated` timestamps in the `Form` entity, as these values are now automatically set in the `FormMapper` class. This improves code readability and reduces redundancy.

The changes also include updates to the `FormMapper` class, where the `insert` and `update` methods now automatically set the `created` and `lastUpdated` timestamps respectively.

Signed-off-by: Christian Hartmann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews php PHP related ticket technical debt Technical issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor lastUpdated handling
1 participant