Fix minor issues and remove Logs
This commit is contained in:
@@ -74,7 +74,7 @@ export default function Page({
|
||||
username: currentUser || "none",
|
||||
};
|
||||
sendRequestwTokenClient(`/ticket/create`, "POST",JSON.stringify(ticket))
|
||||
revalidatePathClient("/tickets","page").then( async () => router.push("/tickets",))
|
||||
revalidatePathClient("/tickets","page").then( () => router.push("/tickets",))
|
||||
};
|
||||
|
||||
if (!currentUser) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {DetailedTicket, getCategories, Ticket} from "@/components/Tickets";
|
||||
import { getTicket } from "@/components/Tickets/getTicket";
|
||||
import {sendRequestwTokenClient} from "@/app/actions/auth";
|
||||
import {revalidatePathClient} from "@/components/revalidatePathClient/revalidatePathClient";
|
||||
import {router} from "next/client";
|
||||
import {useRouter} from "next/navigation";
|
||||
|
||||
export default function Page({
|
||||
params,
|
||||
@@ -15,7 +15,9 @@ export default function Page({
|
||||
params: Promise<{ slug: string }>
|
||||
}) {
|
||||
|
||||
const StateMapping = ["A","B","C"]
|
||||
const router = useRouter();
|
||||
|
||||
const StateMapping = ["Offen","Bearbeitet","Abgeschlossen"]
|
||||
const PrioMapping = ["Niedrig","Mittel","Hoch","Notfall"]
|
||||
|
||||
|
||||
@@ -66,7 +68,7 @@ export default function Page({
|
||||
|
||||
const asyncRedirect = async () => {
|
||||
await revalidatePathClient(`/tickets/${ticketId}`,"page")
|
||||
await router.push("/tickets")
|
||||
router.push("/tickets")
|
||||
}
|
||||
sendRequestwTokenClient(`/ticket/update/${ticketId}`, "POST",JSON.stringify(ticket)).then(asyncRedirect)
|
||||
};
|
||||
|
||||
@@ -8,9 +8,9 @@ export function Button({children, className, onClick, typeStyle = "primary", lin
|
||||
const typStyleCss = () => {
|
||||
switch (typeStyle) {
|
||||
case "primary":
|
||||
return cn("bg-primary", "border-primary", "hover:border-tertiary");
|
||||
return cn("bg-primary", "border-primary", "hover:border-tertiary", "text-white");
|
||||
case "secondary":
|
||||
return cn("bg-primary/75", "border-primary/70", "hover:border-secondary");
|
||||
return cn("bg-primary/75", "border-primary/70", "hover:border-secondary", "text-white");
|
||||
case "tertiary":
|
||||
return cn("border-tertiary", "hover:bg-primary/50", "hover:border-primary");
|
||||
default:
|
||||
|
||||
@@ -37,7 +37,7 @@ export function Header() {
|
||||
<div className={"mr-16 flex flex-row"}>
|
||||
{loggedState &&
|
||||
(<>
|
||||
<Notification/>
|
||||
{/*<Notification/> */}
|
||||
<LogoutButton/>
|
||||
<div className={"m-auto"}>
|
||||
<a>Angemeldet als {username}</a>
|
||||
|
||||
@@ -9,9 +9,9 @@ export function Link({children, className, typeStyle = "primary", href, ...other
|
||||
const typStyleCss = () => {
|
||||
switch (typeStyle) {
|
||||
case "primary":
|
||||
return cn("bg-primary", "border-primary", "hover:border-tertiary");
|
||||
return cn("bg-primary", "border-primary", "hover:border-tertiary", "text-white");
|
||||
case "secondary":
|
||||
return cn("bg-primary/75", "border-primary/70", "hover:border-secondary");
|
||||
return cn("bg-primary/75", "border-primary/70", "hover:border-secondary", "text-white");
|
||||
case "tertiary":
|
||||
return cn("border-tertiary", "hover:bg-primary/50", "hover:border-primary");
|
||||
default:
|
||||
|
||||
@@ -24,7 +24,7 @@ export function Row({
|
||||
className="text-center border-b h-16 hover:bg-primary/10 cursor-pointer transition-colors "
|
||||
>
|
||||
<td>{ticketname}</td>
|
||||
<td>{`${StateMapping[status]}`}</td>
|
||||
<td>{`${StateMapping[status -1]}`}</td>
|
||||
<td>{`${PrioMapping[priority -1]}`}</td>
|
||||
<td>{category}</td>
|
||||
<td>{username}</td>
|
||||
|
||||
@@ -3,10 +3,12 @@ import {Row} from "@/components/TicketTable";
|
||||
import {getTickets} from "@/components/Tickets/getTickets";
|
||||
import Add from "@/components/svg/add";
|
||||
import {Link} from "@/components/Link";
|
||||
import {getCategories} from "@/components/Tickets";
|
||||
|
||||
export async function TicketTable() {
|
||||
|
||||
const tickets = await getTickets();
|
||||
const category = await getCategories();
|
||||
|
||||
return (
|
||||
<div className="flex flex-col w-full px-8">
|
||||
|
||||
@@ -8,10 +8,6 @@ export async function getTickets() {
|
||||
return undefined;
|
||||
}
|
||||
const tickets = await result?.json() as Ticket[];
|
||||
console.log("/////////////////////////////")
|
||||
console.dir(tickets);
|
||||
|
||||
console.log(tickets);
|
||||
|
||||
if (tickets === null || tickets === undefined) {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user