export async function recipeByUID()

in lib/recipes-data/src/lib/dynamo.ts [84:100]


export async function recipeByUID(
	recipeUID: string,
): Promise<RecipeIndexEntry | null> {
	const req = new QueryCommand({
		TableName,
		KeyConditionExpression: 'recipeUID=:uid',
		ExpressionAttributeValues: {
			':uid': { S: recipeUID },
		},
		IndexName: 'idxRecipeUID',
	});

	const response = await client.send(req);
	return response.Items && response.Items.length > 0
		? RecipeIndexEntryFromDynamo(response.Items[0])
		: null;
}