Add query for outfits by submitter

This commit is contained in:
Alex G 2023-10-03 10:47:48 -04:00
parent ce673d6c18
commit c7f15ab3cd

View File

@ -10,4 +10,7 @@ import io.salmonllama.fashionscapeapi.model.Outfit;
public interface OutfitRepository extends JpaRepository<Outfit, String> {
@Query(value = "SELECT o FROM outfit o ORDER BY random() LIMIT 1", nativeQuery = true)
Outfit findRandomOutfit();
@Query(value = "SELECT o FROM outfit o WHERE o.submitter = ?1", nativeQuery = true)
List<Outfit> findUsersOutfits(String userId);
}