Put everything in its right place
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import Head from "next/head";
|
||||
import styles from "../styles/Home.module.css";
|
||||
import Header from "../templates/header";
|
||||
import Nav from "../templates/nav";
|
||||
import Content from "../templates/content";
|
||||
import Footer from "../templates/footer";
|
||||
import Header from "../components/templates/header";
|
||||
import Nav from "../components/templates/nav";
|
||||
import Content from "../components/templates/content";
|
||||
import Footer from "../components/templates/footer";
|
||||
import axios from "axios";
|
||||
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -21,14 +22,11 @@ export default function Kontakt() {
|
||||
email,
|
||||
message
|
||||
}
|
||||
fetch('/api/contact', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json, text/plain, */*',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
}).then((res) => {
|
||||
axios
|
||||
.post("/api/contact", {
|
||||
message: data
|
||||
})
|
||||
.then((res) => {
|
||||
console.log('Response received')
|
||||
if (res.status === 200) {
|
||||
console.log('Response succeeded!')
|
||||
@@ -68,7 +66,6 @@ export default function Kontakt() {
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user