(
&self,
ctx: &Context<'_>,
input: UpsertLinkInput,
)
| 490 | } |
| 491 | |
| 492 | async fn upsert_link( |
| 493 | &self, |
| 494 | ctx: &Context<'_>, |
| 495 | input: UpsertLinkInput, |
| 496 | ) -> Result<UpsertLinkPayload> { |
| 497 | let store = ctx.data_unchecked::<Store>(); |
| 498 | let result = store.upsert_link(input).await?; |
| 499 | |
| 500 | let link_edge = if let Some(link) = &result.link { |
| 501 | let link_id = link.id(); |
| 502 | let link: Link = store.fetch_link(link_id.to_owned()).await?.try_into()?; |
| 503 | Some(LinkEdge::new(String::from("0"), link)) |
| 504 | } else { |
| 505 | None |
| 506 | }; |
| 507 | |
| 508 | Ok(UpsertLinkPayload { |
| 509 | alerts: result.alerts.iter().map(alert::Alert::from).collect_vec(), |
| 510 | link_edge, |
| 511 | }) |
| 512 | } |
| 513 | |
| 514 | async fn upsert_topic( |
| 515 | &self, |
nothing calls this directly
no test coverage detected