From 52c86c942bae1e0e5e7ba97ea93efafbd4c198dd Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Wed, 18 May 2022 19:13:24 +0430 Subject: CRUD tested and working --- src/main/java/com/terminaldweller/doc/DocService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/terminaldweller/doc/DocService.java') diff --git a/src/main/java/com/terminaldweller/doc/DocService.java b/src/main/java/com/terminaldweller/doc/DocService.java index 5a07c23..c8bab23 100644 --- a/src/main/java/com/terminaldweller/doc/DocService.java +++ b/src/main/java/com/terminaldweller/doc/DocService.java @@ -1,6 +1,5 @@ package com.terminaldweller.doc; -import java.util.List; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -15,8 +14,8 @@ public class DocService { this.docRepository = docRepository; } - public List getDocs() { - return docRepository.findAll(); + public Optional getDocs(Long id) { + return docRepository.findById(id); } /** -- cgit v1.2.3