aboutsummaryrefslogtreecommitdiff
path: root/src/app/web-series/components/cacher.js
blob: a75094e9ce55e86d5d9873b3efc8c993dffe2b3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"use server";

import { SERIES_INFO } from "./data-fetch";

const PreFecthSeriesInfo = async (data) => {
	try {
		const fetchPromises = data.results.map(async (element) => {
			await SERIES_INFO(element.id);
		});

		await Promise.all(fetchPromises);
		console.log("Series info pre-fetched successfully!");
	} catch (error) {
		console.error(
			"Error occurred while pre-fetching series info page:",
			error,
		);
	}
};

export default PreFecthSeriesInfo;