mirror of
https://github.com/Sosokker/chefhai.git
synced 2025-12-19 14:04:08 +01:00
15 lines
555 B
TypeScript
15 lines
555 B
TypeScript
import { supabase } from "@/services/supabase";
|
|
import { CookingStep } from "@/types";
|
|
import { PostgrestError } from "@supabase/supabase-js";
|
|
|
|
export const getCookingSteps = async (food_id: string): Promise<{ data: CookingStep[] | null; error: PostgrestError | null }> => {
|
|
const { data, error } = await supabase.from("cooking_steps").select(`
|
|
id,
|
|
created_at,
|
|
food_id,
|
|
step_order,
|
|
title,
|
|
description
|
|
`).eq("food_id", food_id).order("step_order", { ascending: true });
|
|
return { data, error };
|
|
}; |