(
&self,
repo_id: RepoId,
url: &RepoUrl,
title: Option<String>,
add_parent_topic_id: Option<ExternalId>,
)
| 136 | } |
| 137 | |
| 138 | pub fn upsert_link( |
| 139 | &self, |
| 140 | repo_id: RepoId, |
| 141 | url: &RepoUrl, |
| 142 | title: Option<String>, |
| 143 | add_parent_topic_id: Option<ExternalId>, |
| 144 | ) -> UpsertLinkResult { |
| 145 | let html = match &title { |
| 146 | Some(title) => format!("<title>{title}</title>"), |
| 147 | None => "<title>Some title</title>".into(), |
| 148 | }; |
| 149 | |
| 150 | let request = UpsertLink { |
| 151 | actor: actor(), |
| 152 | add_parent_topic_id, |
| 153 | fetcher: Box::new(Fetcher(html)), |
| 154 | repo_id, |
| 155 | url: url.normalized.to_owned(), |
| 156 | title, |
| 157 | }; |
| 158 | |
| 159 | request |
| 160 | .call(self.mutation(), &redis::Noop) |
| 161 | .expect("expected a link") |
| 162 | } |
| 163 | |
| 164 | pub fn upsert_topic( |
| 165 | &self, |
no test coverage detected