Skip to content

Commit f1cc2be

Browse files
relative protocol
1 parent e6a18d4 commit f1cc2be

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/components/AddTodo.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const AddTodo = () => {
1616
todoTextInput.current.value = "";
1717
todoDateInput.current.value = "";
1818

19-
fetch("http://mern-live-backend.azurewebsites.net/todos", {
19+
fetch("//mern-live-backend.azurewebsites.net/todos", {
2020
method: "POST",
2121
headers: { "Content-Type": "application/json" },
2222
body: JSON.stringify({ task: todoText, date: todoDate }),

src/components/LoadItems.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const LoadItems = () => {
1010

1111
useEffect(() => {
1212
setIsLoading(true);
13-
fetch("http://mern-live-backend.azurewebsites.net/todos")
13+
fetch("//mern-live-backend.azurewebsites.net/todos")
1414
.then((res) => res.json())
1515
.then((items) => {
1616
const newItems = items.map(todoItemToClientModel);

src/components/TodoItem.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const TodoItem = ({ id, todoText, todoDate, completed }) => {
66
const [isComplete, setIsComplete] = useState(completed);
77

88
const deleteHandler = () => {
9-
fetch(`http://mern-live-backend.azurewebsites.net/todos/${id}`, {
9+
fetch(`//mern-live-backend.azurewebsites.net/todos/${id}`, {
1010
method: "DELETE",
1111
})
1212
.then((res) => res.json())
@@ -17,7 +17,7 @@ const TodoItem = ({ id, todoText, todoDate, completed }) => {
1717
};
1818

1919
const toggleComplete = () => {
20-
fetch(`http://mern-live-backend.azurewebsites.net/todos/${id}`, {
20+
fetch(`//mern-live-backend.azurewebsites.net/todos/${id}`, {
2121
method: "PATCH",
2222
headers: { "Content-Type": "application/json" },
2323
body: JSON.stringify({ completed: !isComplete }),

0 commit comments

Comments
 (0)