refactor: update axios client import, enhance device and payment handling, and add cancel payment button component
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 6m28s

This commit is contained in:
2025-04-08 21:37:51 +05:00
parent daab793592
commit 7e49bf119a
14 changed files with 270 additions and 178 deletions

View File

@ -15,6 +15,7 @@ import type { Payment } from "@/lib/backend-types";
import { cn } from "@/lib/utils";
import { tryCatch } from "@/utils/tryCatch";
import { Calendar } from "lucide-react";
import { redirect } from "next/navigation";
import Pagination from "./pagination";
import { Badge } from "./ui/badge";
import { Button } from "./ui/button";
@ -86,7 +87,11 @@ export async function PaymentsTable({
const [error, payments] = await tryCatch(getPayments());
if (error) {
return <pre>{JSON.stringify(error, null, 2)}</pre>;
if (error.message.includes("Unauthorized")) {
redirect("/auth/signin");
} else {
return <pre>{JSON.stringify(error, null, 2)}</pre>;
}
}
const { data, meta, links } = payments;
return (