feat: added an endpoint for fething the project an entrepreneur is associated with
This commit is contained in:
@ -14,7 +14,10 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class EntrepreneurApiService {
|
||||
@ -219,4 +222,13 @@ public class EntrepreneurApiService {
|
||||
}
|
||||
throw new ResponseStatusException(HttpStatus.CONFLICT, "User already exists in the system");
|
||||
}
|
||||
|
||||
public Iterable<Project> getProjectIdViaClaim(String email) {
|
||||
Long UserId = this.userService.getUserByEmail(email).getIdUser();
|
||||
Entrepreneur entrepreneur = this.entrepreneurService.getEntrepreneurById(UserId);
|
||||
List<Project> Project_List = new ArrayList<>();
|
||||
;
|
||||
Project_List.add(entrepreneur.getProjectParticipation());
|
||||
return Project_List;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user