Skip to content

Commit

Permalink
Run prettier formatter as part of ci (ref #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutomic committed Oct 25, 2022
1 parent 6709c76 commit b968018
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ steps:
- git submodule init
- git submodule update

- name: check formatting
- name: check css/js formatting
image: node/current-alpine
commands:
- npm install --save-dev --save-exact prettier
- prettier --check assets/
-
- name: check rust formatting
image: rustdocker/rust:nightly
commands:
- /root/.cargo/bin/cargo fmt -- --check
Expand Down
10 changes: 8 additions & 2 deletions src/api/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,14 @@ pub async fn upload_image(
}
let filename = &res.files[0].file;
Ok(Url::parse(&format!(
"{}/pictrs/image/{}?thumbnail=120",
base_url(site_data),
"{}/image/{}?thumbnail=120",
lemmy_backend(),
filename
))?)
}

#[get("/image/<filename>")]
pub async fn serve_image(filename: String
) -> Result<Url, Error> {
CLIENT.get(format!("{}/image/original/{}", lemmy_backend(), filename))
}

0 comments on commit b968018

Please sign in to comment.