leeensminger / OED_Wetlands

0 stars 0 forks source link

Edit Request fails for Mitigiation Site #42

Closed sfabijanski closed 8 years ago

sfabijanski commented 8 years ago

When posting an edit request for mitigation sites. Service throws error stating date in wrong format. The only relevant date field is posted as follows: "OFFSITE_PERMIT_WQC_EXPIRATION":"08/20/2015"

The formatting is picked up from previously established code for date picker. Does this require alteration before posting or is the service causing the problem.

Details of the request. URL: http://vm-city102/Wetland/api/Project/EditMitSite?

REQUEST: Referer: http://localhost:8000/flexviewer_2.2/gov/sha/widgets/wetlands/Wetland.swf Content-type: application/json Content-length: 806 {"PROJECT_MANAGER":"test","FAP_NUMBER":"test","OFFSITE_PERMIT_WWC":"test","MITIGATION_AREA_STATUS":"ACCEPTED","PURCHASE_AREA_ID":"923e256d-b5b1-4fb1-93c2-df5b644e098d","COMMENTS":"test","ON_SITE":"1","MITIGATION_SITE_ID":"c0de7f41-5cac-4d39-8d11-85d1f2a3caa7","TOTAL_AREA_ACRES":"26.45268189","PDMS_NUMBER":"4","MITIGATION_SITE_NUMBER":"141001","TOTAL_MITIGATION_CREDIT_ACRES":"26.45268189","OFFSITE_PERMIT_CAC":"test","ADC_LOC":"test","TOTAL_MITIGATION_CREDIT_LF":"2666.891843","OFFSITE_PERMIT_ES":"test","WATERSHED_8DIG_ID":"a849fb48-fa9b-462d-b8c1-3c58e49433ac","CONSTRUCTION_CONTRACT":"test","OFFSITE_PERMIT_OTHER":"test","PROJECT_ID":"","SITE_DESCRIPTION":"test","OFFSITE_PERMIT_OTHER_DESC":"test","OFFSITE_PERMIT_WQC":"test","SITE_NAME":"test","SHAPE":"","OFFSITE_PERMIT_WQC_EXPIRATION":"08/20/2015"}

RESPONSE: Edit Mit Site Error: ORA-01843: not a valid month ORA-06512: at line 1

vijme commented 8 years ago

@sfabijanski, I have fixed the date issue, please wait for John to update the service. Also, in the above service call, you may need to change one of the input SHAPE from "" to NULL

sfabijanski commented 8 years ago

Is this particular record the issue? There should not be any mitigation sites without SHAPE. The client code in the edit dialog should not even have to consider this attribute and just pass it through as is since it is not editable. I'm not sure coding to bad data is a good idea. I just tried editing the record and received a validation error on missing watershed8 information. I verified a new site gets the watershed applied so I'm guessing this record was created earlier when there was some pieces not yet in place. I plan to delete it.

sfabijanski commented 8 years ago

Ah. I think I see the problem now. SHAPE is not included the normal get request for mit sites. Can I stripe the field out of the post, or does it actually need to be present and null?

vijme commented 8 years ago

@sfabijanski you can remove the SHAPE field from POST, it is not necessary to be present with null value.

sfabijanski commented 8 years ago

With latest service update, now working.