fix: use ServiceError::WebsiteNotFound for site related DB operations

This commit is contained in:
Aravinth Manivannan 2022-11-10 15:23:30 +05:30
parent c86ca3467f
commit 8aa736da27
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
1 changed files with 4 additions and 4 deletions

View File

@ -288,7 +288,7 @@ impl Database {
)
.fetch_one(&self.pool)
.await
.map_err(|e| map_row_not_found_err(e, ServiceError::AccountNotFound))?;
.map_err(|e| map_row_not_found_err(e, ServiceError::WebsiteNotFound))?;
struct Owner {
name: String,
@ -300,7 +300,7 @@ impl Database {
)
.fetch_one(&self.pool)
.await
.map_err(|e| map_row_not_found_err(e, ServiceError::AccountNotFound))?;
.map_err(|e| map_row_not_found_err(e, ServiceError::WebsiteNotFound))?;
let site = Site {
site_secret: site_secret.to_owned(),
@ -326,7 +326,7 @@ impl Database {
)
.fetch_one(&self.pool)
.await
.map_err(|e| map_row_not_found_err(e, ServiceError::AccountNotFound))?;
.map_err(|e| map_row_not_found_err(e, ServiceError::WebsiteNotFound))?;
let res = site.to_site(owner.into());
@ -362,7 +362,7 @@ impl Database {
)
.execute(&self.pool)
.await
.map_err(|e| map_row_not_found_err(e, ServiceError::AccountNotFound))?;
.map_err(|e| map_row_not_found_err(e, ServiceError::WebsiteNotFound))?;
Ok(())
}
}