mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-04 18:11:26 +00:00
refactor: enhance parental control features and improve device blocking logic 🔨
This commit is contained in:
@ -21,11 +21,14 @@ import Pagination from "./pagination";
|
||||
export async function DevicesTable({
|
||||
searchParams,
|
||||
parentalControl,
|
||||
additionalFilters = {},
|
||||
|
||||
}: {
|
||||
searchParams: Promise<{
|
||||
[key: string]: unknown;
|
||||
}>;
|
||||
parentalControl?: boolean;
|
||||
additionalFilters?: Record<string, string | number | boolean>;
|
||||
}) {
|
||||
const resolvedParams = await searchParams;
|
||||
const session = await getServerSession(authOptions);
|
||||
@ -42,9 +45,15 @@ export async function DevicesTable({
|
||||
apiParams[key] = typeof value === "number" ? value : String(value);
|
||||
}
|
||||
}
|
||||
|
||||
for (const [key, value] of Object.entries(additionalFilters)) {
|
||||
if (value !== undefined && value !== "") {
|
||||
apiParams[key] = typeof value === "number" ? value : String(value);
|
||||
}
|
||||
}
|
||||
apiParams.limit = limit;
|
||||
apiParams.offset = offset;
|
||||
|
||||
console.log("API Params:", apiParams);
|
||||
const [error, devices] = await tryCatch(
|
||||
getDevices(apiParams),
|
||||
);
|
||||
|
Reference in New Issue
Block a user