mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-02 09:48:22 +00:00
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
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 6m28s
This commit is contained in:
@ -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 (
|
||||
|
Reference in New Issue
Block a user