-
Notifications
You must be signed in to change notification settings - Fork 3
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: LCFS - BUG AG Grid copy and paste function for Fuel codes table … #1420
Conversation
…on IDIR side not functioning #1302
@@ -229,10 +231,12 @@ const AddEditFuelCodeBase = () => { | |||
const errMsg = `Error updating row: ${ | |||
fieldLabels.length === 1 ? fieldLabels[0] : '' | |||
} ${message}` | |||
|
|||
updatedData.validationMsg = errMsg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and received 422, when processing the date fields. They are not in correct format. Then, needed to give a proper format. Something like this:
// Format date fields to ISO 8601
const formattedData = { ...params.node.data };
dateFields.forEach((field) => {
if (formattedData[field]) {
const date = new Date(formattedData[field]);
if (!isNaN(date.getTime())) {
formattedData[field] = date.toISOString().split('T')[0]; // Keep only the YYYY-MM-DD part
}
}
});
let updatedData = Object.entries(formattedData)
After that the request passes the schema validation, it can start executing create_fuel_code. However, an error is raised: ValueError: Invalid transport mode: Truck
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review @areyeslo ,
- yes, from excel , date needs to be copied in proper format otherwise it throws error.
- Truck is no longer among the valid transport mode in the database. hence value error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for adding support for different date types.
…on IDIR side not functioning #1302