Function restapi::requests::user::delete_user::delete_user
source · [−]pub async fn delete_user(
tracking_label: &str,
config: &CoreConfig,
db_pool: &Pool<PostgresConnectionManager<MakeTlsConnector>>,
kafka_pool: &KafkaPublisher,
headers: &HeaderMap<HeaderValue>,
bytes: &[u8]
) -> Result<Response<Body>, Infallible>
Expand description
delete_user
Handles deleting a user by changing the
users.state
to 1
.
This change is enforced on
login_user
when the user tries to login again and on the
validate_user_token
for any existing user jwt’s.
Overview Notes
A user can only have one record in the users
table.
Arguments
tracking_label
-&str
- caller logging labelconfig
-CoreConfig
db_pool
-Pool
- postgres client db threadpool with required tls encryptionkafka_pool
-KafkaPublisher
for asynchronously publishing messages to the connected kafka clusterheaders
-HeaderMap
- hashmap containing headers in key-value pairsRequest
’sBody
bytes
-&[u8]
- received bytes from the hyperRequest
’sBody
Returns
Success
Deletes a user in the db
hyper Response
containing a json-serialized
ApiResUserDelete
dictionary within the
Body
and a
204
HTTP status code
Ok(Response
)
Errors
All errors return as a
hyper Response
containing a json-serialized
ApiResUserDelete
dictionary with a
non-204
HTTP status code
Err(Response
)