Login, logout and middleware updates

This commit is contained in:
Darren Clarke 2024-12-13 16:37:20 +01:00
parent f552f8024f
commit 9fb3665ced
18 changed files with 96 additions and 50 deletions

View file

@ -1,6 +1,5 @@
"use server";
import { revalidatePath } from "next/cache";
import { getTicketQuery } from "app/_graphql/getTicketQuery";
import { getTicketArticlesQuery } from "app/_graphql/getTicketArticlesQuery";
import { createTicketMutation } from "app/_graphql/createTicketMutation";
@ -157,13 +156,14 @@ export const getTicketStatesAction = async () => {
const states = await executeREST({
path: "/api/v1/ticket_states",
});
console.log({ states });
const formattedStates =
states?.map((state: any) => ({
value: `gid://zammad/Ticket::State/${state.id}`,
label: state.name,
disabled: ["new", "merged", "removed"].includes(state.name),
})) ?? [];
console.log({ formattedStates });
return formattedStates;
} catch (e) {
console.error(e.message);