Skip to content

Commit 8d32e56

Browse files
committed
Updated API url
1 parent 74f7d98 commit 8d32e56

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ allcode.txt
2323
*.njsproj
2424
*.sln
2525
*.sw?
26+
27+
.env.*

src/api/statementsApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { Statement } from '../../types/types';
66
export async function postNewStatement(statement: Statement): Promise<void> {
77
try {
88
// POST operation
9-
const postResponse = await fetch(`${API_URL}newEntry`, {
9+
const postResponse = await fetch(`${API_URL}/newEntry`, {
1010
method: 'POST',
1111
headers: {
1212
'Content-Type': 'application/json',
@@ -20,7 +20,7 @@ export async function postNewStatement(statement: Statement): Promise<void> {
2020
console.log('Successfully posted:', postData);
2121

2222
// Optionally, if you want to fetch updated data after posting:
23-
const getResponse = await fetch(`${API_URL}n/s/${statement.subject}`);
23+
const getResponse = await fetch(`${API_URL}/n/s/${statement.subject}`);
2424
if (!getResponse.ok) {
2525
throw new Error(`HTTP error on GET! status: ${getResponse.status}`);
2626
}

0 commit comments

Comments
 (0)