Skip to content

Commit

Permalink
fixed client fetch methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan-Roberts123 committed Apr 26, 2024
1 parent be2bf1b commit a326abf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pages/add-client.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Add = () => {

const handleSubmit = async () => {
event.preventDefault()
const res = await fetch(`${process.env.WEBURL}/api/add-client`, {
const res = await fetch('/api/add-client', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(newClient)
Expand Down
4 changes: 2 additions & 2 deletions pages/edit/[id].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Edit = ({ data }) => {

const handleSubmit = async e => {
e.preventDefault()
const res = await fetch(`${process.env.WEBURL}/api/update-client`, {
const res = await fetch('/api/update-client', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(client)
Expand All @@ -39,7 +39,7 @@ const Edit = ({ data }) => {

const handleDelete = async e => {
e.preventDefault()
const res = await fetch(`${process.env.WEBURL}/api/delete-client`, {
const res = await fetch('/api/delete-client', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ id: client.id, name: client.name })
Expand Down

0 comments on commit a326abf

Please sign in to comment.