Conversation
📝 HackYourFuture auto gradeAssignment Score: 80 / 100 ✅Status: ✅ Passed Test Details |
| const alcoholic = `**Alcoholic:** ${drink.strAlcoholic}`; | ||
| const instructions = `### Instructions\n${drink.strInstructions}`; | ||
| const glass = `**Glass:** ${drink.strGlass}`; | ||
| let ingredients = "### Ingredients\n"; |
There was a problem hiding this comment.
Lists in markdown should have blank lines before and after, so another \n after ingredients
| glass; | ||
| markdown.push(block); | ||
| } | ||
| const content = markdown.join("\n\n"); |
There was a problem hiding this comment.
The file should start with #Coctail Recipes at the first line
const content = "# Cocktail Recipes\n\n" + markdown.join("\n\n");
| for (const drink of data.drinks) { | ||
| const name = `## ${drink.strDrink}`; | ||
| const image = ``; | ||
| const category = `**Category:** ${drink.strCategory}`; |
There was a problem hiding this comment.
The colon should be outside the bold marker
const category = Category: ${drink.strCategory};
const alcoholic = Alcoholic: ${drink.strAlcoholic};
and there should be a blank line between them
| const category = `**Category:** ${drink.strCategory}`; | ||
| const alcoholic = `**Alcoholic:** ${drink.strAlcoholic}`; | ||
| const instructions = `### Instructions\n${drink.strInstructions}`; | ||
| const glass = `**Glass:** ${drink.strGlass}`; |
There was a problem hiding this comment.
This should be serve in
const glass = Serve in: ${drink.strGlass};
| throw error; | ||
| } | ||
| if (data.drinks === null) { | ||
| return; |
There was a problem hiding this comment.
Here should be error handling
if (data.drinks === null) {
console.error("No cocktails found with that name.");
return;
}
| // 4. Handle errors | ||
| console.error("Failed to get or to write cocktail data:", error.message); | ||
| } | ||
| //return data; |
There was a problem hiding this comment.
the commented-out code should be deleted
| */ | ||
| const deletePost = async (id) => { | ||
| // TODO | ||
| const response = await fetch(`${BASE_URL}/posts/:id `, { |
There was a problem hiding this comment.
You should add the parameter as a variable to the url: ${BASE_URL}/posts/${id}
| */ | ||
| const updatePost = async (id, text) => { | ||
| // TODO | ||
| const response = await fetch(`${BASE_URL}/posts/id`, { |
There was a problem hiding this comment.
the id should be added as a variable : ${BASE_URL}/posts/${id}
| const getPosts = async () => { | ||
| // TODO | ||
| const response = await fetch(`${BASE_URL}/posts/me`, { | ||
| method: "Get", |
There was a problem hiding this comment.
Get works, but the convention is GET
| const getMe = async () => { | ||
| // TODO | ||
| const response = await fetch(`${BASE_URL}/users/me`, { | ||
| method: "Get", |
There was a problem hiding this comment.
Get works, but the convention is GET
No description provided.