package app.mealsmadeeasy.api.recipe;

import app.mealsmadeeasy.api.user.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.UUID;

public interface RecipeDraftRepository extends JpaRepository<RecipeDraft, UUID> {

    @Query("SELECT r FROM RecipeDraft r WHERE :user = r.owner")
    List<RecipeDraft> findAllViewableBy(User user);

}
