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

[Bug] edit_order command results in weird behaviour #289

Closed
HmuuMyatMoe opened this issue Apr 8, 2023 · 0 comments · Fixed by #290
Closed

[Bug] edit_order command results in weird behaviour #289

HmuuMyatMoe opened this issue Apr 8, 2023 · 0 comments · Fixed by #290

Comments

@HmuuMyatMoe
Copy link

HmuuMyatMoe commented Apr 8, 2023

Steps to reproduce:

  1. Use edit_o command to edit any field
  2. Close and re-start the app
  3. The order name of the edited order becomes INVALID

image

@HmuuMyatMoe HmuuMyatMoe added this to tP Apr 8, 2023
@HmuuMyatMoe HmuuMyatMoe added this to the v1.4 milestone Apr 8, 2023
LiuMC-SG added a commit that referenced this issue Apr 8, 2023
Fixes #289 

Reason for bug:
* Order has OrderName and MenuItem data fields
* But when storing order as JsonAdaptedOrder, we only keep track of the
MenuItem
* In the previous implementation of edit order command, only the
OrderName field is updated and MenuItem is not (After parsing the edit
order command input, in `EditOrderCommand::createEditedItem()`, the
edited Order object is created with the updated OrderName only, which
calls the Order constructor that only initialize the order name
correctly and initialize MenuItem as `INVALID`)

Changes made:
* Make `EditOrderCommand::createEditedItem()`, create the edited Order
object with the updated MenuItem instead of OrderName
@github-project-automation github-project-automation bot moved this to Done in tP Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant