revised backend service getObjects
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
import { loginUser, logoutUser } from '$lib/server/authService';
|
||||
import { redirectIfVorgangExists } from '$lib/server/vorgangService.js';
|
||||
|
||||
import { getVorgangByCaseId } from '$lib/server/vorgangService.js';
|
||||
|
||||
export const actions = {
|
||||
login: ({ request, cookies }) => loginUser({request, cookies}),
|
||||
login: ({ request, cookies }) => loginUser({ request, cookies }),
|
||||
logout: (event) => logoutUser(event),
|
||||
redirectToVorgang: ({request}) => redirectIfVorgangExists(request)
|
||||
getVorgangById: async ({ request }) => {
|
||||
const data = await request.formData();
|
||||
const caseId = data.get('case-id');
|
||||
const caseToken = data.get('case-token');
|
||||
const result = await getVorgangByCaseId(caseId, caseToken);
|
||||
|
||||
console.log(result);
|
||||
}
|
||||
} as const;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="w-full max-w-sm mx-auto">
|
||||
<div class="relative mt-5 bg-gray-50 rounded-xl shadow-xl p-3 pt-1">
|
||||
<div class="mt-10">
|
||||
<form action="?/redirectToVorgang" method="POST">
|
||||
<form action="?/getVorgangById" method="POST">
|
||||
<BaseInputField
|
||||
id="case-id"
|
||||
name="case-id"
|
||||
|
||||
Reference in New Issue
Block a user