Skip to content

Commit

Permalink
fixed buggy urls and updated github actions CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlux58 committed Jan 13, 2024
1 parent 39cfc71 commit cf8894a
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions frontend/client-app/src/components/errors/TestError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,32 @@ import { useState } from "react";
import ValidationError from "./ValidationError";

export default function TestErrors() {
const baseUrl = import.meta.env.VITE_API_URL + "/api/";
const [errors, setErrors] = useState(null);

// const baseUrl = import.meta.env.VITE_API_URL;

function handleNotFound() {
axios
.get(baseUrl + "/buggy/not-found")
.catch((err) => console.log(err.response));
axios.get("/buggy/not-found").catch((err) => console.log(err.response));
}

function handleBadRequest() {
axios
.get(baseUrl + "/buggy/bad-request")
.catch((err) => console.log(err.response));
axios.get("/buggy/bad-request").catch((err) => console.log(err.response));
}

function handleServerError() {
axios
.get(baseUrl + "/buggy/server-error")
.catch((err) => console.log(err.response));
axios.get("/buggy/server-error").catch((err) => console.log(err.response));
}

function handleUnauthorized() {
axios
.get(baseUrl + "/buggy/unauthorized")
.catch((err) => console.log(err.response));
axios.get("/buggy/unauthorized").catch((err) => console.log(err.response));
}

function handleBadGuid() {
axios
.get(baseUrl + "/activities/notaguid")
.catch((err) => console.log(err.response));
axios.get("/activities/notaguid").catch((err) => console.log(err.response));
}

function handleValidationError() {
axios.post(baseUrl + "/activities", {}).catch((err) => setErrors(err));
axios.post("/activities", {}).catch((err) => setErrors(err));
}

return (
Expand Down

0 comments on commit cf8894a

Please sign in to comment.