Skip to content

Commit

Permalink
corrected site url
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan-Roberts123 committed Apr 26, 2024
1 parent 0420c72 commit 94976d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 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.MONGODB_URI}/api/add-client`, {
const res = await fetch(`${process.env.WEBURL}/api/add-client`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(newClient)
Expand Down
6 changes: 3 additions & 3 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.MONGODB_URI}/api/update-client`, {
const res = await fetch(`${process.env.WEBURL}/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.MONGODB_URI}/api/delete-client`, {
const res = await fetch(`${process.env.WEBURL}/api/delete-client`, {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ id: client.id, name: client.name })
Expand Down Expand Up @@ -205,7 +205,7 @@ const Edit = ({ data }) => {

Edit.getInitialProps = async function (context) {
const { id } = context.query
const res = await fetch(`${process.env.MONGODB_URI}/api/get-client?id=${id}`)
const res = await fetch(`${process.env.WEBURL}/api/get-client?id=${id}`)
const data = await res.json()

return { data: data.user }
Expand Down
2 changes: 1 addition & 1 deletion pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Home = ({ clients }) => (
)

Home.getInitialProps = async function () {
const res = await fetch(`${process.env.MONGODB_URI}/api/clients`)
const res = await fetch(`${process.env.WEBURL}/api/clients`)
const data = await res.json()

return {
Expand Down

0 comments on commit 94976d2

Please sign in to comment.