Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit aef74978 authored by Peter Rabbit's avatar Peter Rabbit
Browse files

fix useless async keyword

parent 47e55840
No related branches found
No related tags found
1 merge request!1Dev
......@@ -83,6 +83,7 @@ _Env vars may be defined in a .env file at the root of the project_
## Tests
Create a public/standard/test_sitemap.xml file with a sitemap structure in order to pass the tests.
Create a public/testing empty directory
## Admin panel - create a Play Button
**Syntax**
......
async function fetch_article(article_id) {
function fetch_article(article_id) {
return new Promise((resolve, reject) => {
fetch(`/article/${article_id}`).then(async res => {
if (res.status >= 400 && res.status < 600) {
......@@ -11,7 +11,7 @@ async function fetch_article(article_id) {
})
}
async function fetch_articles_by_category(category) {
function fetch_articles_by_category(category) {
return new Promise((resolve, reject) => {
fetch(`/articles/${category}`).then(async res => {
if (res.status >= 400 && res.status < 600) {
......@@ -24,7 +24,7 @@ async function fetch_articles_by_category(category) {
})
}
async function fetch_post_article(article_data) {
function fetch_post_article(article_data) {
return new Promise((resolve, reject) => {
fetch("/post-article", {
credentials: 'include',
......@@ -47,7 +47,7 @@ async function fetch_post_article(article_data) {
})
}
async function fetch_update_article(article_data) {
function fetch_update_article(article_data) {
return new Promise((resolve, reject) => {
fetch(`/update-article/${article_data._id.$oid}`, {
credentials: 'include',
......@@ -70,7 +70,7 @@ async function fetch_update_article(article_data) {
})
}
async function fetch_delete_article(article_id) {
function fetch_delete_article(article_id) {
return new Promise((resolve, reject) => {
fetch(`/delete-article/${article_id}`, {
credentials: 'include',
......@@ -88,7 +88,7 @@ async function fetch_delete_article(article_id) {
});
}
async function fetch_all_articles() {
function fetch_all_articles() {
return new Promise((resolve, reject) => {
fetch(`/articles`)
.then(async res => {
......
......@@ -21,12 +21,11 @@ pub fn get_tls_config() -> ServerConfig {
let host = env_var("SERVER_HOST").expect("SERVER_HOST is not defined.");
let mut config = ServerConfig::new(NoClientAuth::new());
let certs_dir = std::path::PathBuf::from(
env_var("RESOURCES_DIR").expect("RESOURCES_DIR is not defined"),
)
.join("certs")
.join("live")
.join(&host);
let certs_dir =
std::path::PathBuf::from(env_var("RESOURCES_DIR").expect("RESOURCES_DIR is not defined"))
.join("certs")
.join("live")
.join(&host);
let cert_file = File::open(certs_dir.join("fullchain.pem")).unwrap();
let key_file = File::open(certs_dir.join("privkey.pem")).unwrap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment