.
This commit is contained in:
@@ -1,23 +1,25 @@
|
||||
---
|
||||
|
||||
import AusweisLayout from "#layouts/AusweisLayoutDaten_partner.astro";
|
||||
import BedarfsausweisWohnenModule from "#modules/BedarfsausweisWohnen/BedarfsausweisWohnenModule.svelte";
|
||||
import { AufnahmeClient, BedarfsausweisWohnenClient, ObjektClient, UploadedGebaeudeBild, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types";
|
||||
import { AufnahmeClient, ObjektClient, BildClient, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types";
|
||||
import { createCaller } from "src/astro-typesafe-api-caller";
|
||||
import { API_ACCESS_TOKEN_COOKIE_NAME } from "#lib/constants";
|
||||
import { validateAccessTokenServer } from "#server/lib/validateAccessToken";
|
||||
import { Enums } from "#lib/server/prisma";
|
||||
|
||||
const uid = Astro.url.searchParams.get("uid");
|
||||
const id = Astro.url.searchParams.get("uid") || "";
|
||||
const aufnahme_id = Astro.url.searchParams.get("aufnahme")
|
||||
const ausweistyp = Astro.url.searchParams.get("ausweistyp") || Enums.AusweisTyp.Standard;
|
||||
let ausweis: VerbrauchsausweisWohnenClient = {} as VerbrauchsausweisWohnenClient;
|
||||
let aufnahme: AufnahmeClient = {} as AufnahmeClient;
|
||||
let objekt: ObjektClient = {} as ObjektClient;
|
||||
let bilder: UploadedGebaeudeBild[] = []
|
||||
let bilder: BildClient[] = []
|
||||
|
||||
const valid = validateAccessTokenServer(Astro);
|
||||
|
||||
const caller = createCaller(Astro);
|
||||
|
||||
if (uid) {
|
||||
if (id) {
|
||||
if (!valid) {
|
||||
return Astro.redirect(
|
||||
`/auth/login?redirect=${Astro.url.toString()}`
|
||||
@@ -25,39 +27,39 @@ if (uid) {
|
||||
}
|
||||
|
||||
try {
|
||||
ausweis = await caller["bedarfsausweis-wohnen"]._uid.GET.fetch(null, {
|
||||
ausweis = await caller["bedarfsausweis-wohnen"]._id.GET.fetch(null, {
|
||||
headers: {
|
||||
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
|
||||
},
|
||||
params: {
|
||||
uid
|
||||
id
|
||||
}
|
||||
});
|
||||
|
||||
aufnahme = await caller.aufnahme._uid.GET.fetch(null, {
|
||||
aufnahme = await caller.aufnahme._id.GET.fetch(null, {
|
||||
headers: {
|
||||
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
|
||||
},
|
||||
params: {
|
||||
uid: ausweis.uid_aufnahme
|
||||
id: ausweis.aufnahme_id
|
||||
}
|
||||
})
|
||||
|
||||
objekt = await caller.objekt._uid.GET.fetch(null, {
|
||||
objekt = await caller.objekt._id.GET.fetch(null, {
|
||||
headers: {
|
||||
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
|
||||
},
|
||||
params: {
|
||||
uid: ausweis.uid_objekt
|
||||
id: ausweis.objekt_id
|
||||
}
|
||||
})
|
||||
|
||||
bilder = await caller.aufnahme._uid.bilder.GET.fetch(null, {
|
||||
bilder = await caller.aufnahme._id.bilder.GET.fetch(null, {
|
||||
headers: {
|
||||
authorization: `Bearer ${Astro.cookies.get(API_ACCESS_TOKEN_COOKIE_NAME)?.value}`
|
||||
},
|
||||
params: {
|
||||
uid: ausweis.uid_aufnahme
|
||||
id: ausweis.aufnahme_id
|
||||
}
|
||||
})
|
||||
|
||||
@@ -77,6 +79,6 @@ if (uid) {
|
||||
|
||||
|
||||
---
|
||||
<AusweisLayout title="Bedarfsausweis erstellen | IBCornelsen" tabHover3="glow">
|
||||
<BedarfsausweisWohnenModule client:load {ausweis} {objekt} {aufnahme} {bilder}></BedarfsausweisWohnenModule>
|
||||
<AusweisLayout title="Bedarfsausweis erstellen | IBCornelsen">
|
||||
<BedarfsausweisWohnenModule client:only {ausweis} {objekt} {aufnahme} {bilder} {ausweistyp} {id}></BedarfsausweisWohnenModule>
|
||||
</AusweisLayout>
|
||||
@@ -2,7 +2,7 @@
|
||||
import Layout from "#layouts/Layout.astro";
|
||||
import ProduktVergleich from "#components/design/content/ProduktVergleich.svelte";
|
||||
import ProduktVergleichGewerbe from "#components/design/content/ProduktVergleichGewerbe.svelte";
|
||||
import WelcherAusweisWidget from "#components/widgets/WelcherAusweisWidget_IBC.svelte";
|
||||
import WelcherAusweisWidget from "#components/widgets/ibcornelsen/WelcherAusweisWidget_ibcornelsen.svelte";
|
||||
import TextboxCardTemplate from "#components/design/content/TextboxCardTemplate.svelte";
|
||||
|
||||
---
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
import Layout from "#layouts/Layout.astro";
|
||||
import WelcherAusweisWidget from "#components/widgets/WelcherAusweisWidget_IBC.svelte";
|
||||
import WelcherAusweisWidget from "#components/widgets/ibcornelsen/WelcherAusweisWidget_ibcornelsen.svelte";
|
||||
import TextboxCardTemplate from "#components/design/content/TextboxCardTemplate.svelte";
|
||||
|
||||
---
|
||||
|
||||
22
src/pages/widgets/immonet.astro
Normal file
22
src/pages/widgets/immonet.astro
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
const { vermittler } = Astro.params;
|
||||
import WelcherAusweisWidget from "#components/widgets/immonet/WelcherAusweisWidget_immonet.svelte";
|
||||
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<WelcherAusweisWidget client:load/>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import WelcherAusweisWidget from "#components/widgets/immowelt/WelcherAusweisWidget_immowelt.svelte";
|
||||
const { vermittler } = Astro.params;
|
||||
import WelcherAusweisWidget from "#components/widgets/immowelt/WelcherAusweisWidget_immowelt.svelte";
|
||||
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
22
src/pages/widgets/vermittler.astro
Normal file
22
src/pages/widgets/vermittler.astro
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
const { vermittler } = Astro.params;
|
||||
import WelcherAusweisWidget from "#components/widgets/immowelt/WelcherAusweisWidget_immowelt.svelte";
|
||||
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<WelcherAusweisWidget client:load/>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user