mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-01 15:23:58 +00:00
feat: enhance error handling and improve API response management across components
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m39s
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m39s
This commit is contained in:
@ -40,8 +40,11 @@ export async function DevicesTable({
|
||||
getDevices({ query: query, limit: limit, offset: offset }),
|
||||
);
|
||||
if (error) {
|
||||
if (error.message === "Invalid token.") redirect("/auth/signin");
|
||||
return <ClientErrorMessage message={error.message} />;
|
||||
if (error.message === "UNAUTHORIZED") {
|
||||
redirect("/auth/signin");
|
||||
} else {
|
||||
return <ClientErrorMessage message={error.message} />;
|
||||
}
|
||||
}
|
||||
const { meta, data } = devices;
|
||||
return (
|
||||
@ -77,7 +80,7 @@ export async function DevicesTable({
|
||||
<TableCell colSpan={2}>
|
||||
{query?.length > 0 && (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Showing {meta?.total} locations for "{query}
|
||||
Showing {meta?.total} devices for "{query}
|
||||
"
|
||||
</p>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user