This commit is contained in:
jleroy2023
2025-07-18 14:15:22 +02:00
parent 3670254845
commit 0262ec23e2
2 changed files with 2 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ public class StockServiceImpl implements StockService{
@Override @Override
public Stock findByRef(String ref) { public Stock findByRef(String ref) {
Stock stock = stockRepository.findByRefEQ(ref); Stock stock = stockRepository.findByRef(ref);
if (stock == null) { if (stock == null) {
throw new EntityNotFoundException("Ref non valide"); throw new EntityNotFoundException("Ref non valide");
} }

View File

@@ -9,5 +9,5 @@ import java.util.List;
@Repository @Repository
public interface StockRepository extends MongoRepository<Stock,Long> { public interface StockRepository extends MongoRepository<Stock,Long> {
List<Stock> findByNameIsContainingIgnoreCaseAndIsRentFalse(String name); List<Stock> findByNameIsContainingIgnoreCaseAndIsRentFalse(String name);
Stock findByRefEQ(String ref); Stock findByRef(String ref);
} }