Skip to content

Commit

Permalink
lns: remove view all
Browse files Browse the repository at this point in the history
  • Loading branch information
drjova committed Feb 15, 2024
1 parent 676e940 commit 24b1d91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from ..api import (
get_backoffice_latest_pids,
get_catalogue_site_url,
get_results_from_pids,
send_channel_request,
)
Expand Down Expand Up @@ -54,9 +53,7 @@ def cli(subjects: Tuple[str, ...], title: str, target: str) -> None:
click.echo("No results visible in the catalogue!")
return

url = get_catalogue_site_url(query)

message = create_channel_message(results, title, url)
message = create_channel_message(results, title)
click.echo(
f"Subject: {subjects} - Title: {title} - Results: {len(results)} results."
)
Expand Down
5 changes: 1 addition & 4 deletions Library-Notification-Service/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def get_pids_from_docs(docs: List[dict]) -> List[str]:
return pids


def create_channel_message(message: List[dict], title: str, url: str) -> str:
def create_channel_message(message: List[dict], title: str) -> str:
html_string = f"<h4>Latest books/e-books for {title}</h4>\n<ul>\n"
for doc in message:
doc_id = doc.get("id", "")
Expand All @@ -110,7 +110,4 @@ def create_channel_message(message: List[dict], title: str, url: str) -> str:
html_string += f"<li><a href='{doc_url}'>{doc_title}</a></li>\n"
html_string += "</ul>"

if len(message) > 10:
html_string += f"<p><a href='{url}'>View all</a></p>"

return html_string

0 comments on commit 24b1d91

Please sign in to comment.