Add backend feedback submission and image preview
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
@@ -234,6 +234,37 @@ impl SpacetimeClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn submit_profile_feedback(
|
||||
&self,
|
||||
user_id: String,
|
||||
description: String,
|
||||
contact_phone: Option<String>,
|
||||
evidence_items: Vec<module_runtime::RuntimeProfileFeedbackEvidenceSnapshot>,
|
||||
created_at_micros: i64,
|
||||
) -> Result<RuntimeProfileFeedbackSubmissionRecord, SpacetimeClientError> {
|
||||
let procedure_input = build_runtime_profile_feedback_submission_input(
|
||||
user_id,
|
||||
description,
|
||||
contact_phone,
|
||||
evidence_items,
|
||||
created_at_micros,
|
||||
)
|
||||
.map_err(SpacetimeClientError::validation_failed)?
|
||||
.into();
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.submit_profile_feedback_and_return_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_runtime_profile_feedback_submission_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn get_profile_referral_invite_center(
|
||||
&self,
|
||||
user_id: String,
|
||||
@@ -385,14 +416,15 @@ impl SpacetimeClient {
|
||||
.into();
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.query_analytics_metric_then(procedure_input, move |_, result| {
|
||||
connection.procedures().query_analytics_metric_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_analytics_metric_query_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
},
|
||||
);
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user