diff --git a/.env.example b/.env.example index 4eaa8a5..75f523f 100644 --- a/.env.example +++ b/.env.example @@ -1 +1 @@ -NEXT_PUBLIC_BACKEND_URL = http://localhost:3000 +NEXT_PUBLIC_BACKEND_URL = http://localhost:3001 diff --git a/package-lock.json b/package-lock.json index a7b151e..86d93d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2930,6 +2930,11 @@ "node": ">= 0.6" } }, + "node_modules/fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==" + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -4540,6 +4545,15 @@ "node": ">= 0.8" } }, + "node_modules/path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==", + "dependencies": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4885,6 +4899,14 @@ "node": ">= 0.8.0" } }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -6144,11 +6166,24 @@ } } }, + "node_modules/util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dependencies": { + "inherits": "2.0.3" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", diff --git a/src/components/displayTable/DataDisplay.tsx b/src/components/displayTable/DataDisplay.tsx index d7794fa..e9a28ea 100644 --- a/src/components/displayTable/DataDisplay.tsx +++ b/src/components/displayTable/DataDisplay.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from "react"; import { RowType } from "@/types/types"; import TableRow from "./Row"; -import { getData } from "@/utils/api"; +import { getData } from "@/utils/forminputhandling"; type DataDisplayProps = { getData: () => Promise; diff --git a/src/pages/SessionCreator.tsx b/src/pages/SessionCreator.tsx index 46fc1ef..54b75dd 100644 --- a/src/pages/SessionCreator.tsx +++ b/src/pages/SessionCreator.tsx @@ -3,7 +3,7 @@ import StudentDetails from "@/components/Steps/StudentDetails"; import { TestDetails } from "@/components/Steps/TestDetails"; import Timeline from "@/components/Steps/Timeline"; import { RowType } from "@/types/types"; -import { postFormData } from "@/utils/api"; +import { postFormData } from "@/utils/forminputhandling"; import { useState } from "react"; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 05461f0..8c5cd97 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,6 +1,5 @@ import DataDisplay from "@/components/displayTable/DataDisplay"; -import { getData } from "@/utils/api"; -import { get } from "http"; +import { getData } from "@/utils/forminputhandling"; // import { Inter } from "next/font/google"; import Head from "next/head"; import { useRouter } from "next/router"; diff --git a/src/utils/api.ts b/src/utils/forminputhandling.ts similarity index 90% rename from src/utils/api.ts rename to src/utils/forminputhandling.ts index 503dbcb..d354b27 100644 --- a/src/utils/api.ts +++ b/src/utils/forminputhandling.ts @@ -1,5 +1,5 @@ import { RowType } from "@/types/types"; -import { instance } from "./axios"; +import { instance } from "./rootclient"; // get data from the db async function getData() { diff --git a/src/utils/axios.ts b/src/utils/rootclient.ts similarity index 100% rename from src/utils/axios.ts rename to src/utils/rootclient.ts