mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 18:14:53 +02:00
show resources table, check org access, and handle redirects on root
This commit is contained in:
parent
edde7a247a
commit
f6c7c017cb
14 changed files with 416 additions and 95 deletions
|
@ -79,7 +79,7 @@ function queryResources(
|
|||
}
|
||||
}
|
||||
|
||||
export type ListSitesResponse = {
|
||||
export type ListResourcesResponse = {
|
||||
resources: NonNullable<Awaited<ReturnType<typeof queryResources>>>;
|
||||
pagination: { total: number; limit: number; offset: number };
|
||||
};
|
||||
|
@ -126,7 +126,7 @@ export async function listResources(
|
|||
);
|
||||
}
|
||||
|
||||
if (orgId && orgId !== req.orgId) {
|
||||
if (orgId && orgId !== req.userOrgId) {
|
||||
return next(
|
||||
createHttpError(
|
||||
HttpCode.FORBIDDEN,
|
||||
|
@ -167,7 +167,7 @@ export async function listResources(
|
|||
const totalCountResult = await countQuery;
|
||||
const totalCount = totalCountResult[0].count;
|
||||
|
||||
return response<ListSitesResponse>(res, {
|
||||
return response<ListResourcesResponse>(res, {
|
||||
data: {
|
||||
resources: resourcesList,
|
||||
pagination: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue