Skip to content

Commit

Permalink
Add cache no-store on fetch API
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Nov 2, 2023
1 parent 696b822 commit e7f3a5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/getCarRegistrationByMake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import type { Car } from "@/types";
export const getCarRegistrationByMake = async (
filePath: string,
): Promise<Car[]> => {
const csvContent: string = await fetch(filePath).then((res) => res.text());
const csvContent: string = await fetch(filePath, { cache: "no-store" }).then(
(res) => res.text(),
);
const carRegistrationByMake: Car[] = d3.csvParse(csvContent, (car: Car) => ({
...car,
number: +car.number,
Expand Down

0 comments on commit e7f3a5c

Please sign in to comment.