chore: get rid of direct DB init and use db_*

This commit is contained in:
realaravinth
2022-05-27 18:25:27 +05:30
parent cd72ae6ffe
commit d7fd23f565
25 changed files with 55 additions and 63 deletions

View File

@@ -33,7 +33,7 @@ pub async fn email_exists(
payload: web::Json<AccountCheckPayload>,
data: AppData,
) -> ServiceResult<impl Responder> {
let exists = data.dblib.email_exists(&payload.val).await?;
let exists = data.db.email_exists(&payload.val).await?;
let resp = AccountCheckResp { exists };
@@ -59,7 +59,7 @@ async fn set_email(
new_email: &payload.email,
};
data.dblib.update_email(&update_email).await?;
data.db.update_email(&update_email).await?;
Ok(HttpResponse::Ok())
}