async function takeRecipeDown()

in lib/recipes-data/src/lib/takedown.ts [23:59]


async function takeRecipeDown({
	canonicalArticleId,
	recipe,
	mode,
	staticBucketName,
	fastlyApiKey,
	contentPrefix,
}: {
	canonicalArticleId: string;
	recipe: RecipeIndexEntry;
	mode: TakedownMode;
	staticBucketName: string;
	fastlyApiKey: string;
	contentPrefix: string;
}): Promise<void> {
	console.log(
		`takeRecipeDown: removing recipe ${recipe.recipeUID} for ${canonicalArticleId} from the index`,
	);
	await removeRecipe(
		canonicalArticleId,
		recipe.recipeUID,
		mode == TakedownMode.AllVersions ? undefined : recipe.checksum,
	);

	console.log(
		`takeRecipeDown: removing content version ${recipe.checksum} for ${recipe.recipeUID} on ${canonicalArticleId} from the store`,
	);
	await removeRecipeContent({
		recipeSHA: recipe.checksum,
		staticBucketName: staticBucketName,
		fastlyApiKey: fastlyApiKey,
		contentPrefix,
	});
	console.log(
		`takeRecipeDown: complete for ${recipe.checksum} for ${recipe.recipeUID} on ${canonicalArticleId}`,
	);
}