Commit ebb60b88 by Vijay Gawariya

resolve conflict

parents b5e494f7 303b764b
......@@ -6,7 +6,6 @@ class Api::V1::RecipesController < ApplicationController
def create
recipe = Recipe.create!(recipe_params)
print recipe_params
if recipe
render json: recipe
else
......
......@@ -93,37 +93,6 @@ class NewRecipe extends React.Component {
.catch(error => console.log(error.message));
}
// submitFile(event) {
// event.preventDefault();
// const url = "/api/v1/recipes/uploadFile";
// const { file } = this.state;
// if (file.length == 0)
// return;
// const body = { file };
// console.log(body);
// const token = document.querySelector('meta[name="csrf-token"]').content;
// const formData = new FormData()
// formData.append("file", file)
// fetch(url, {
// method: "POST",
// headers: {
// "X-CSRF-Token": token,
// },
// body: formData
// })
// .then(response => {
// if (response.ok) {
// alert("AAAAAAAAAAA")
// // return response.json();
// console.log(response.json);
// }
// throw new Error("Network response was not ok.");
// })
// .catch(error => console.log(error.message));
// }
render() {
return (
<div className="container mt-5">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment