Skip to content

Conversation

@AndrewTr0612
Copy link
Contributor

@AndrewTr0612 AndrewTr0612 commented Dec 5, 2025

Description

(This PR updates the /edit route in units.js so that unit fields are only updated when those parameters are specifically provided. Previously, the route set all unit values even when some were not passed in the request body, which could result in unintended changes.

Contributors

Thien An Truong, @AndrewTr0612 email: [email protected]
Anthony Duenez Ramirez, @anthonyduenez email: [email protected]
Nathan Espina, @Nespina24, email: [email protected]
Princeton Nguyen, @princetonn, email: [email protected]
Fixes #1534

Type of change

(Check the ones that apply by placing an "x" instead of the space in the [ ] so it becomes [x])

  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

(Note what you have done by placing an "x" instead of the space in the [ ] so it becomes [x]. It is hoped you do all of them.)

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request
  • You acknowledge that every person contributing to this work has signed the OED Contributing License Agreement and each author is listed in the Description section.

Limitations

This change addresses only the behavior of the /edit route in units.js. No additional validation are included.

@danielbachhuber
Copy link
Contributor

I created a test you can extend to cover this new behavior: AndrewTr0612#4

…-endpoint

Stub out a basic test for the /edit endpoint
@huss
Copy link
Member

huss commented Dec 6, 2025

@AndrewTr0612 & @danielbachhuber I wanted to know if this PR is ready for my review or if I should hold off given the comments made. Thanks.

@danielbachhuber
Copy link
Contributor

I wanted to know if this PR is ready for my review or if I should hold off given the comments made.

@huss As of my conversation with them on Friday, they're going to try to address my comments first.

@anthonyduenez
Copy link
Contributor

@huss The PR is ready for review, I just finished addressing the comments.

Copy link
Member

@huss huss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to @AndrewTr0612, @anthonyduenez, @Nespina24 & @princetonn for their first contribution to OED. Overall, this looks good. I made a few comments to consider. Please let me know if you have any thoughts, something is not clear or I can help.

@anthonyduenez
Copy link
Contributor

@huss The PR is ready for review. I loved your feedback, I did all the changes you recommended!

Copy link
Member

@huss huss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my comments. Review and testing found it works as desired. Congratulations to @AndrewTr0612, @anthonyduenez, @Nespina24 & @princetonn on having your work merged into OED.

@huss huss merged commit be8b974 into OpenEnergyDashboard:development Dec 12, 2025
3 checks passed
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.

Fix unit route so not overwrite unspecified values

4 participants