Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lsolcher committed Oct 18, 2024
1 parent eaefb52 commit d59f727
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import Background from "@digitalcheck/shared/components/Background.tsx";
import Container from "@digitalcheck/shared/components/Container.tsx";
import { json, useLoaderData, useOutletContext } from "@remix-run/react";

import DetailInfo from "@digitalcheck/shared/components/DetailInfo.tsx";
import { LoaderFunction } from "@remix-run/node";
import { type Prinzip } from "../utils/strapiData.server.ts";

export const loader: LoaderFunction = async ({ params }) => {
export const loader: LoaderFunction = ({ params }) => {
const slug = params.prinzip;
if (!slug) throw new Response("Prinzip not found", { status: 404 });

Check warning on line 9 in packages/dito/app/routes/digitaltauglichkeit.prinzipien.$prinzip.tsx

View workflow job for this annotation

GitHub Actions / check-test-build-deploy (dito) / check-and-test-shared / check-and-test

Expected an error object to be thrown

Check warning on line 9 in packages/dito/app/routes/digitaltauglichkeit.prinzipien.$prinzip.tsx

View workflow job for this annotation

GitHub Actions / check-test-build-deploy (dito) / check-and-test-shared / check-and-test

Expected an error object to be thrown
return json({ slug });
Expand All @@ -17,20 +15,11 @@ export default function Digitaltauglichkeit_Prinzipien_Detail() {
const prinzips: Prinzip[] = useOutletContext();
const prinzip = prinzips.find((prinzip) => prinzip.slug === slug);
if (!prinzip) {
return (
<Background backgroundColor="blue">
<Container>
<h1>Prinzip not found</h1>
<p>Sorry, the requested principle could not be found.</p>
</Container>
</Background>
);
throw new Response("Prinzip not found", { status: 404 });

Check warning on line 18 in packages/dito/app/routes/digitaltauglichkeit.prinzipien.$prinzip.tsx

View workflow job for this annotation

GitHub Actions / check-test-build-deploy (dito) / check-and-test-shared / check-and-test

Expected an error object to be thrown

Check warning on line 18 in packages/dito/app/routes/digitaltauglichkeit.prinzipien.$prinzip.tsx

View workflow job for this annotation

GitHub Actions / check-test-build-deploy (dito) / check-and-test-shared / check-and-test

Expected an error object to be thrown
}
return (
<>
<Container>
<DetailInfo label={["asa", "abc"]} />

<h2>All Properties:</h2>
<ul>
{Object.entries(prinzip).map(([key, value]) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const meta: MetaFunction = ({ matches }) => {
return prependMetaTitle(ROUTE_PRINZIPLES.title, matches);
};

// Loader to fetch Prinzip data
export async function loader() {
const digitalSuitabilityFlag = unleash.isEnabled(
"digitalcheck.digital-suitability",
Expand All @@ -31,11 +30,9 @@ export async function loader() {
}

const prinzipData = await getPrinzips();

const test = json({
return json({
prinzips: prinzipData?.data.prinzips,
});
return test;
}

export default function Prinzipien() {
Expand All @@ -44,11 +41,7 @@ export default function Prinzipien() {
return (
<>
<Background backgroundColor="blue">
<Container>
{/*
<h1>{selectedPrinciple}</h1>
*/}
</Container>
<Container>Alle Prinzipien</Container>
</Background>
<div>
<h1>Prinzipien</h1>
Expand Down

0 comments on commit d59f727

Please sign in to comment.