Pulling hair out here.
await req(options, async function (error: string, response: string, body: {
message: string,
session: string,
course: string
}) {
if (error) throw new Error(error);
if (body.session) {
setSession(body.session);
}
});
setSession(body.session) doesnt work. because its a hook.
also cant run my return redirect in there either so it needs to set session somehow.
how can i do this?