@@ -18,7 +18,6 @@ import {
1818} from '../../types/failure-with-status' ;
1919import { StatusCodes } from 'http-status-codes' ;
2020import { dbExecute } from '../../util' ;
21- import { LastGoogleSheetRowRead } from '../../read-models/shared-state/return-types' ;
2221
2322// Note that this isn't automatically type safe. It does rely on the cached
2423// data actually being the type of DomainEvent we say it is.
@@ -33,16 +32,6 @@ const extractCachedEvents = <R>(
3332 E . map ( elements => elements as ReadonlyArray < R > )
3433 ) ;
3534
36- const extractLastRowRead = (
37- rawLastRowReadData : string
38- ) : t . Validation < LastGoogleSheetRowRead > =>
39- pipe (
40- rawLastRowReadData ,
41- tt . JsonFromString . decode ,
42- E . chain ( tt . JsonRecord . decode ) ,
43- E . chain ( t . record ( t . string , t . record ( t . string , t . number ) ) . decode )
44- ) ;
45-
4635export const getCachedSheetData =
4736 < R > ( dbClient : Client ) =>
4837 (
@@ -51,7 +40,6 @@ export const getCachedSheetData =
5140 FailureWithStatus ,
5241 O . Option < {
5342 cached_at : Date ;
54- last_row_read : t . Validation < LastGoogleSheetRowRead > ;
5543 cached_data : t . Validation < ReadonlyArray < R > > ;
5644 } >
5745 > =>
@@ -82,7 +70,6 @@ export const getCachedSheetData =
8270 table . rows ,
8371 RA . map ( row => ( {
8472 ...row ,
85- last_row_read : extractLastRowRead ( row . last_row_read ) ,
8673 cached_data : extractCachedEvents < R > ( row . cached_data ) ,
8774 } ) ) ,
8875 RA . head
0 commit comments