Skip to content

Commit bd7ef10

Browse files
Updating files
1 parent 5c318ba commit bd7ef10

File tree

7 files changed

+1654
-43001
lines changed

7 files changed

+1654
-43001
lines changed

backend/node_modules/.package-lock.json

Lines changed: 810 additions & 21224 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package-lock.json

Lines changed: 826 additions & 21764 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"license": "ISC",
1414
"dependencies": {
1515
"cors": "^2.8.5",
16+
"dotenv": "^16.3.1",
1617
"express": "^4.18.2",
1718
"mongoose": "^7.4.5",
1819
"nodemon": "^3.0.1"

backend/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ mongoose
2222
app.listen(5000, () => {
2323
console.log("app running");
2424
});
25-
//console.log();
25+
2626
module.exports = app;

frontend/src/components/DisplayTask.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const DisplayTask = (props) => {
1313
const [tempdata, setdata] = useState(data);
1414
useEffect(() => {
1515
const fetchData = async () => {
16-
const tempData = await fetch("http://127.0.0.1:5000/api/v1/tasks");
16+
const tempData = await fetch("https://noteit-api2.onrender.com/api/v1/tasks");
1717
const JsonData = await tempData.json();
1818
data = JsonData.data;
1919
setdata(data);
@@ -65,11 +65,11 @@ const DisplayTask = (props) => {
6565
}
6666
}
6767
async function position() {
68-
await fetch("http://127.0.0.1:5000/api/v1/tasks", {
68+
await fetch("https://noteit-api2.onrender.com/api/v1/tasks", {
6969
method: "DELETE",
7070
});
7171
// console.log("del");
72-
await fetch("http://127.0.0.1:5000/api/v1/tasks/many", {
72+
await fetch("https://noteit-api2.onrender.com/api/v1/tasks/many", {
7373
method: "POST",
7474
body: JSON.stringify(tempArray),
7575
headers: {
@@ -88,7 +88,7 @@ const DisplayTask = (props) => {
8888
};
8989
if (todo.length === 0) {
9090
async function todoAdd() {
91-
await fetch("http://127.0.0.1:5000/api/v1/tasks", {
91+
await fetch("https://noteit-api2.onrender.com/api/v1/tasks", {
9292
method: "POST",
9393
body: JSON.stringify({
9494
title: "No task for this stage",
@@ -100,7 +100,7 @@ const DisplayTask = (props) => {
100100
}
101101
if (done.length === 0) {
102102
async function todoAdd() {
103-
await fetch("http://127.0.0.1:5000/api/v1/tasks", {
103+
await fetch("https://noteit-api2.onrender.com/api/v1/tasks", {
104104
method: "POST",
105105
body: JSON.stringify({
106106
title: "No task for this stage",
@@ -113,7 +113,7 @@ const DisplayTask = (props) => {
113113
}
114114
if (doing.length === 0) {
115115
async function todoAdd() {
116-
await fetch("http://127.0.0.1:5000/api/v1/tasks", {
116+
await fetch("https://noteit-api2.onrender.com/api/v1/tasks", {
117117
method: "POST",
118118
body: JSON.stringify({
119119
title: "No task for this stage",

frontend/src/components/TaskModal/TaskForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const TaskForm = (props) => {
77
title: titleRef.current.value,
88
description: descriptionRef.current.value,
99
};
10-
const temp = await fetch("http://127.0.0.1:5000/api/v1/tasks", {
10+
const temp = await fetch("https://noteit-api2.onrender.com/api/v1/tasks", {
1111
method: "POST",
1212
mode: "cors",
1313
body: JSON.stringify(data),

frontend/src/components/UpdateTaskForm.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const UpdateTaskForm = (props) => {
2020
useEffect(() => {
2121
const getData = async () => {
2222
const temp = await fetch(
23-
`http://127.0.0.1:5000/api/v1/tasks/${props.id}`
23+
`https://noteit-api2.onrender.com/api/v1/tasks/${props.id}`
2424
);
2525
const dataObject = await temp.json();
2626
console.log(dataObject.data[0].title);
@@ -44,23 +44,27 @@ const UpdateTaskForm = (props) => {
4444
data.status === "doing"
4545
) {
4646
console.log(data);
47-
fetch(`http://127.0.0.1:5000/api/v1/tasks/${props.id}`, {
47+
fetch(`https://noteit-api2.onrender.com/api/v1/tasks/${props.id}`, {
4848
method: "PATCH",
4949
body: JSON.stringify(data),
5050
headers: {
5151
"Content-Type": "application/json",
5252
},
5353
});
54-
window.location.reload();
54+
setTimeout(() => {
55+
window.location.reload();
56+
}, 1500);
5557
} else {
5658
setValidate(true);
5759
}
5860
};
5961
const onDelete = () => {
60-
fetch(`http://127.0.0.1:5000/api/v1/tasks/${props.id}`, {
62+
fetch(`https://noteit-api2.onrender.com/api/v1/tasks/${props.id}`, {
6163
method: "DELETE",
6264
});
63-
window.location.reload();
65+
setTimeout(() => {
66+
window.location.reload();
67+
}, 1500);
6468
};
6569
return (
6670
<div>

0 commit comments

Comments
 (0)