MCPcopy Create free account
hub / github.com/hashintel/hash / create_org_web

Method create_org_web

libs/@local/graph/postgres-store/src/store/postgres/mod.rs:3818–3862  ·  view source on GitHub ↗
(
        &mut self,
        actor_id: ActorEntityUuid,
        params: CreateOrgWebParams,
    )

Source from the content-addressed store, hash-verified

3816
3817 #[tracing::instrument(level = "info", skip(self))]
3818 async fn create_org_web(
3819 &mut self,
3820 actor_id: ActorEntityUuid,
3821 params: CreateOrgWebParams,
3822 ) -> Result<CreateWebResponse, Report<WebInsertionError>> {
3823 let mut transaction = self.transaction().await.change_context(WebInsertionError)?;
3824
3825 let actor_id = transaction
3826 .determine_actor(actor_id)
3827 .await
3828 .change_context(WebInsertionError)?
3829 .ok_or(WebInsertionError)
3830 .attach_opaque(StatusCode::Unauthenticated)?;
3831
3832 let administrator = if let Some(administrator) = params.administrator {
3833 transaction
3834 .determine_actor(administrator)
3835 .await
3836 .change_context(WebInsertionError)?
3837 .ok_or(WebInsertionError)
3838 .attach_opaque(StatusCode::InvalidArgument)?
3839 } else {
3840 actor_id
3841 };
3842
3843 let response = transaction
3844 .create_web(
3845 actor_id,
3846 CreateWebParameter {
3847 id: None,
3848 shortname: Some(params.shortname),
3849 administrator: Some(administrator),
3850 is_actor_web: false,
3851 },
3852 )
3853 .await
3854 .change_context(WebInsertionError)?;
3855
3856 transaction
3857 .commit()
3858 .await
3859 .change_context(WebInsertionError)?;
3860
3861 Ok(response)
3862 }
3863
3864 async fn get_web_by_id(
3865 &self,

Callers

nothing calls this directly

Calls 7

OkInterface · 0.85
change_contextMethod · 0.45
transactionMethod · 0.45
attach_opaqueMethod · 0.45
determine_actorMethod · 0.45
create_webMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected