Skip to content

Commit

Permalink
Remove one more usage of deprecated function #3234
Browse files Browse the repository at this point in the history
  • Loading branch information
erkannt committed May 13, 2024
1 parent 7f03463 commit b5370c3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as TE from 'fp-ts/TaskEither';
import { pipe } from 'fp-ts/function';
import { fetchData } from '../fetch-data';
import * as CR from '../third-parties/crossref';
import { deprecatedIngestionWindowStartDate } from '../time';
import { ingestionWindowStartDate } from '../time';
import { constructPublishedEvaluation } from '../types/published-evaluation';
import { DiscoverPublishedEvaluations } from '../update-all';

Expand Down Expand Up @@ -57,8 +57,8 @@ const fetchPaginatedData = (baseUrl: string, offset: number): TE.TaskEither<stri
)),
);

const identifyCandidates = (doiPrefix: string, reviewDoiPrefix: string) => {
const startDate = deprecatedIngestionWindowStartDate(5).toISOString().split('T')[0];
const identifyCandidates = (doiPrefix: string, reviewDoiPrefix: string, ingestDays: number) => {
const startDate = ingestionWindowStartDate(ingestDays).toISOString().split('T')[0];
const today = new Date().toISOString().split('T')[0];
const baseUrl = `https://api.biorxiv.org/publisher/${doiPrefix}/${startDate}/${today}`;
return pipe(
Expand All @@ -71,8 +71,8 @@ const identifyCandidates = (doiPrefix: string, reviewDoiPrefix: string) => {
export const discoverEvaluationsFromCrossrefViaBiorxiv = (
doiPrefix: string,
reviewDoiPrefix: string,
): DiscoverPublishedEvaluations => () => () => pipe(
identifyCandidates(doiPrefix, reviewDoiPrefix),
): DiscoverPublishedEvaluations => (ingestDays) => () => pipe(
identifyCandidates(doiPrefix, reviewDoiPrefix, ingestDays),
TE.map(RA.map(toEvaluation)),
TE.map((evaluations) => ({
understood: evaluations,
Expand Down

0 comments on commit b5370c3

Please sign in to comment.