Working apalis cron and worker with 0.6.0-rc.5
Also renamed `pool` variables throughout codebase to `db` for clarity.
This commit is contained in:
@@ -9,15 +9,15 @@ use crate::models::entry::{CreateEntry, Entry};
|
||||
use crate::uuid::Base62Uuid;
|
||||
|
||||
pub async fn get(
|
||||
State(pool): State<PgPool>,
|
||||
State(db): State<PgPool>,
|
||||
Path(id): Path<Base62Uuid>,
|
||||
) -> Result<Json<Entry>, Error> {
|
||||
Ok(Json(Entry::get(&pool, id.as_uuid()).await?))
|
||||
Ok(Json(Entry::get(&db, id.as_uuid()).await?))
|
||||
}
|
||||
|
||||
pub async fn post(
|
||||
State(pool): State<PgPool>,
|
||||
State(db): State<PgPool>,
|
||||
Json(payload): Json<CreateEntry>,
|
||||
) -> Result<Json<Entry>, Error> {
|
||||
Ok(Json(Entry::create(&pool, payload).await?))
|
||||
Ok(Json(Entry::create(&db, payload).await?))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user