Add backend code to delete entries that have already been read + start collecitng data on usage data so we can eventually prune data from users that are no longer using hishtory

This commit is contained in:
David Dworken
2022-04-16 11:37:43 -07:00
parent f80c39f6f0
commit a436edbd16
4 changed files with 46 additions and 3 deletions

View File

@ -43,6 +43,7 @@ func TestESubmitThenQuery(t *testing.T) {
// Query for device id 1
w := httptest.NewRecorder()
// TODO: update this to include the user ID
searchReq := httptest.NewRequest(http.MethodGet, "/?device_id="+devId1, nil)
apiEQueryHandler(w, searchReq)
res := w.Result()
@ -72,6 +73,7 @@ func TestESubmitThenQuery(t *testing.T) {
// Same for device id 2
w = httptest.NewRecorder()
// TODO: update this to include the user ID
searchReq = httptest.NewRequest(http.MethodGet, "/?device_id="+devId2, nil)
apiEQueryHandler(w, searchReq)
res = w.Result()
@ -101,6 +103,7 @@ func TestESubmitThenQuery(t *testing.T) {
// Bootstrap handler should return 2 entries, one for each device
w = httptest.NewRecorder()
searchReq = httptest.NewRequest(http.MethodGet, "/?user_id="+data.UserId("key"), nil)
// TODO: update to include device_id
apiEBootstrapHandler(w, searchReq)
res = w.Result()
defer res.Body.Close()