SRJPE / rst-pilot-app-client

Rotary Screw Trap Data Collection application
0 stars 0 forks source link

Fix successful submissions not being removed from cache #283

Closed JordanHoang closed 5 months ago

JordanHoang commented 5 months ago

so I’m seeing where in the other placesin the code where we have a fullfilled.type the logic we are doing is monitoring program

      state.submissionStatus = 'submission-successful'
      state.previousMonitoringProgramSubmissions = [
        ...state.previousMonitoringProgramSubmissions,
        ...monitoringProgramPostResult,
      ]
      state.monitoringProgramSubmissions = []

mark recapture

      const markRecapturePostResult = action.payload.markRecaptureResponse
      const markRecaptureReleaseCrewPostResult =
        action.payload.markRecaptureReleaseCrewResponse
      const markRecaptureReleaseMarksPostResult =
        action.payload.markRecaptureReleaseMarksResponse

      state.submissionStatus = 'submission-successful'
      state.previousMarkRecaptureSubmissions = [
        ...state.previousMarkRecaptureSubmissions,
        ...markRecapturePostResult,
      ]
      state.markRecaptureSubmissions = []

      state.previousMarkRecaptureReleaseCrewSubmissions = [
        ...state.previousMarkRecaptureReleaseCrewSubmissions,
        ...markRecaptureReleaseCrewPostResult,
      ]
      state.markRecaptureReleaseCrewSubmissions = []

      state.previousMarkRecaptureReleaseMarksSubmissions = [
        ...state.previousMarkRecaptureReleaseMarksSubmissions,
        ...markRecaptureReleaseMarksPostResult,
      ]
      state.markRecaptureReleaseMarksSubmissions = []

      console.log('successful mark Recap post processing: ', action.payload)

but in trap visit, not doing anything

    [postTrapVisitFormSubmissions.fulfilled.type]: (state, action) => {
      state.submissionStatus = 'submission-successful'
      console.log('successful post processing: ', action.payload)
    },
JordanHoang commented 5 months ago

look into this comment:

We did have logic there But for whatever reason, looks like I removed logic there during this commit