mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-06 18:56:39 +00:00
🏷️ fix types
This commit is contained in:
@@ -4,7 +4,6 @@ import { internal } from "@app/lib/api";
|
|||||||
import { authCookieHeader } from "@app/lib/api/cookies";
|
import { authCookieHeader } from "@app/lib/api/cookies";
|
||||||
import { getCachedOrg } from "@app/lib/api/getCachedOrg";
|
import { getCachedOrg } from "@app/lib/api/getCachedOrg";
|
||||||
import OrgProvider from "@app/providers/OrgProvider";
|
import OrgProvider from "@app/providers/OrgProvider";
|
||||||
import type { ListApprovalsResponse } from "@server/private/routers/approvals";
|
|
||||||
import type { GetOrgResponse } from "@server/routers/org";
|
import type { GetOrgResponse } from "@server/routers/org";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
import { getTranslations } from "next-intl/server";
|
import { getTranslations } from "next-intl/server";
|
||||||
@@ -13,13 +12,26 @@ export interface ApprovalFeedPageProps {
|
|||||||
params: Promise<{ orgId: string }>;
|
params: Promise<{ orgId: string }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ApprovalItem = {
|
||||||
|
approvalId: number;
|
||||||
|
orgId: string;
|
||||||
|
clientId: number | null;
|
||||||
|
decision: "pending" | "approved" | "denied";
|
||||||
|
type: "user_device";
|
||||||
|
user: {
|
||||||
|
name: string | null;
|
||||||
|
userId: string;
|
||||||
|
username: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export default async function ApprovalFeedPage(props: ApprovalFeedPageProps) {
|
export default async function ApprovalFeedPage(props: ApprovalFeedPageProps) {
|
||||||
const params = await props.params;
|
const params = await props.params;
|
||||||
|
|
||||||
let approvals: ListApprovalsResponse["approvals"] = [];
|
let approvals: ApprovalItem[] = [];
|
||||||
const res = await internal
|
const res = await internal
|
||||||
.get<
|
.get<
|
||||||
AxiosResponse<ListApprovalsResponse>
|
AxiosResponse<{ approvals: ApprovalItem[] }>
|
||||||
>(`/org/${params.orgId}/approvals`, await authCookieHeader())
|
>(`/org/${params.orgId}/approvals`, await authCookieHeader())
|
||||||
.catch((e) => {});
|
.catch((e) => {});
|
||||||
|
|
||||||
Reference in New Issue
Block a user