Fixed actix routing the new agent id req to the shortcode route

This commit is contained in:
Franklin 2023-04-25 09:22:21 -04:00
parent 39510e0a9d
commit 4b0f963579
3 changed files with 65 additions and 65 deletions

View File

@ -7,4 +7,4 @@ SELECT
profile_picture_url,
time_created,
last_updated
FROM agent WHERE id = $1
FROM agent WHERE id = $1;

View File

@ -694,6 +694,68 @@
},
"query": "UPDATE agent SET\n full_name = $1,\n shortcode = $2,\n credential = $3,\n credential_type = $4,\n profile_picture_url = $5,\n last_updated = $6\nWHERE id = $7\nRETURNING \n id,\n shortcode,\n full_name,\n credential,\n credential_type as \"credential_type: _\",\n profile_picture_url,\n time_created,\n last_updated;"
},
"971799e74ce858ded9f6b5206c7e7b38cc2817c0bed4be889546028b30b74e3d": {
"describe": {
"columns": [
{
"name": "id",
"ordinal": 0,
"type_info": "Uuid"
},
{
"name": "shortcode",
"ordinal": 1,
"type_info": "Varchar"
},
{
"name": "full_name",
"ordinal": 2,
"type_info": "Varchar"
},
{
"name": "credential",
"ordinal": 3,
"type_info": "Varchar"
},
{
"name": "credential_type: _",
"ordinal": 4,
"type_info": "Varchar"
},
{
"name": "profile_picture_url",
"ordinal": 5,
"type_info": "Varchar"
},
{
"name": "time_created",
"ordinal": 6,
"type_info": "Timestamptz"
},
{
"name": "last_updated",
"ordinal": 7,
"type_info": "Timestamptz"
}
],
"nullable": [
false,
false,
false,
false,
false,
false,
false,
false
],
"parameters": {
"Left": [
"Uuid"
]
}
},
"query": "SELECT \n id,\n shortcode,\n full_name,\n credential,\n credential_type as \"credential_type: _\",\n profile_picture_url,\n time_created,\n last_updated\nFROM agent WHERE id = $1;"
},
"a6f20728a46711e230dd31f5489a620554cea3e4093a3a4c727f91301811ffea": {
"describe": {
"columns": [
@ -1242,68 +1304,6 @@
},
"query": "SELECT \nid,\nproject_state as \"project_state: _\",\nproject_type as \"project_type: _\",\nproject_condition as \"project_condition: _\",\nagent_id,\nlocation_id,\ntitle,\ndescription,\nadmin_tag,\nfinish_date,\nfloors,\nmedia as \"media: _\",\ntime_created,\nlast_updated\nFROM project WHERE id = ANY($1);"
},
"d65a90a10c18f22d7e9a266fa45b6ec2622b1a039cea6b9b65c48f441a3781e4": {
"describe": {
"columns": [
{
"name": "id",
"ordinal": 0,
"type_info": "Uuid"
},
{
"name": "shortcode",
"ordinal": 1,
"type_info": "Varchar"
},
{
"name": "full_name",
"ordinal": 2,
"type_info": "Varchar"
},
{
"name": "credential",
"ordinal": 3,
"type_info": "Varchar"
},
{
"name": "credential_type: _",
"ordinal": 4,
"type_info": "Varchar"
},
{
"name": "profile_picture_url",
"ordinal": 5,
"type_info": "Varchar"
},
{
"name": "time_created",
"ordinal": 6,
"type_info": "Timestamptz"
},
{
"name": "last_updated",
"ordinal": 7,
"type_info": "Timestamptz"
}
],
"nullable": [
false,
false,
false,
false,
false,
false,
false,
false
],
"parameters": {
"Left": [
"Uuid"
]
}
},
"query": "SELECT \n id,\n shortcode,\n full_name,\n credential,\n credential_type as \"credential_type: _\",\n profile_picture_url,\n time_created,\n last_updated\nFROM agent WHERE id = $1"
},
"e15c1255cfa5d8075536949f04cb5bc5cc03336dee8cc417297ba02e7c8bff77": {
"describe": {
"columns": [],

View File

@ -31,8 +31,8 @@ pub async fn get_all_agents(db_conn: web::Data<Arc<PgPool>>) -> TypedHttpRespons
services::read::get_all_agents(&db_conn).await
}
#[get("/agent/{id}")]
pub async fn get_agent_with_id(db_conn: web::Data<Arc<PgPool>>, id: Path<Uuid>) -> TypedHttpResponse<Agent> {
#[get("/agent/uid/{id}")]
pub async fn get_agent_with_id(db_conn: web::Data<Arc<PgPool>>, id: web::Path<Uuid>) -> TypedHttpResponse<Agent> {
services::read::get_agent_with_id(&db_conn, &id).await
}