mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 13:27:46 +00:00
Fix: type errors
This commit is contained in:
@@ -507,8 +507,7 @@ export const registerRoutes = async (
|
|||||||
smtpService,
|
smtpService,
|
||||||
userDAL,
|
userDAL,
|
||||||
groupDAL,
|
groupDAL,
|
||||||
orgBotDAL,
|
orgBotDAL
|
||||||
projectRoleDAL
|
|
||||||
});
|
});
|
||||||
const signupService = authSignupServiceFactory({
|
const signupService = authSignupServiceFactory({
|
||||||
tokenService,
|
tokenService,
|
||||||
@@ -518,7 +517,6 @@ export const registerRoutes = async (
|
|||||||
userGroupMembershipDAL,
|
userGroupMembershipDAL,
|
||||||
projectKeyDAL,
|
projectKeyDAL,
|
||||||
projectDAL,
|
projectDAL,
|
||||||
projectRoleDAL,
|
|
||||||
projectBotDAL,
|
projectBotDAL,
|
||||||
groupProjectDAL,
|
groupProjectDAL,
|
||||||
projectMembershipDAL,
|
projectMembershipDAL,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|||||||
|
|
||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { userKeys } from "../users/queries";
|
import { userKeys } from "../users";
|
||||||
import {
|
import {
|
||||||
APIKeyDataV2,
|
APIKeyDataV2,
|
||||||
CreateAPIKeyDataV2DTO,
|
CreateAPIKeyDataV2DTO,
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { apiRequest } from "@app/config/request";
|
|||||||
|
|
||||||
import { Actor, AuditLog, AuditLogFilters } from "./types";
|
import { Actor, AuditLog, AuditLogFilters } from "./types";
|
||||||
|
|
||||||
export const workspaceKeys = {
|
export const auditLogKeys = {
|
||||||
getAuditLogs: (filters: AuditLogFilters, workspaceId: string | null) =>
|
getAuditLogs: (workspaceId: string | null, filters: AuditLogFilters) =>
|
||||||
[{ workspaceId, filters }, "audit-logs"] as const,
|
[{ workspaceId, filters }, "audit-logs"] as const,
|
||||||
getAuditLogActorFilterOpts: (workspaceId: string) =>
|
getAuditLogActorFilterOpts: (workspaceId: string) =>
|
||||||
[{ workspaceId }, "audit-log-actor-filters"] as const
|
[{ workspaceId }, "audit-log-actor-filters"] as const
|
||||||
@@ -13,9 +13,7 @@ export const workspaceKeys = {
|
|||||||
|
|
||||||
export const useGetAuditLogs = (filters: AuditLogFilters, workspaceId: string | null) => {
|
export const useGetAuditLogs = (filters: AuditLogFilters, workspaceId: string | null) => {
|
||||||
return useInfiniteQuery({
|
return useInfiniteQuery({
|
||||||
queryKey: workspaceKeys.getAuditLogs(filters, workspaceId),
|
queryKey: auditLogKeys.getAuditLogs(workspaceId, filters),
|
||||||
enabled: workspaceId !== "",
|
|
||||||
|
|
||||||
queryFn: async ({ pageParam }) => {
|
queryFn: async ({ pageParam }) => {
|
||||||
const auditLogEndpoint = workspaceId
|
const auditLogEndpoint = workspaceId
|
||||||
? `/api/v1/workspace/${workspaceId}/audit-logs`
|
? `/api/v1/workspace/${workspaceId}/audit-logs`
|
||||||
@@ -37,7 +35,7 @@ export const useGetAuditLogs = (filters: AuditLogFilters, workspaceId: string |
|
|||||||
|
|
||||||
export const useGetAuditLogActorFilterOpts = (workspaceId: string) => {
|
export const useGetAuditLogActorFilterOpts = (workspaceId: string) => {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: workspaceKeys.getAuditLogActorFilterOpts(workspaceId),
|
queryKey: auditLogKeys.getAuditLogActorFilterOpts(workspaceId),
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const { data } = await apiRequest.get<{ actors: Actor[] }>(
|
const { data } = await apiRequest.get<{ actors: Actor[] }>(
|
||||||
`/api/v1/workspace/${workspaceId}/audit-logs/filters/actors`
|
`/api/v1/workspace/${workspaceId}/audit-logs/filters/actors`
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { apiRequest } from "@app/config/request";
|
|||||||
import { setAuthToken } from "@app/reactQuery";
|
import { setAuthToken } from "@app/reactQuery";
|
||||||
|
|
||||||
import { organizationKeys } from "../organization/queries";
|
import { organizationKeys } from "../organization/queries";
|
||||||
import { workspaceKeys } from "../workspace/queries";
|
import { workspaceKeys } from "../workspace";
|
||||||
import {
|
import {
|
||||||
ChangePasswordDTO,
|
ChangePasswordDTO,
|
||||||
CompleteAccountDTO,
|
CompleteAccountDTO,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|||||||
|
|
||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { workspaceKeys } from "../workspace/queries";
|
import { workspaceKeys } from "../workspace";
|
||||||
import { caKeys } from "./queries";
|
import { caKeys } from "./queries";
|
||||||
import {
|
import {
|
||||||
TCertificateAuthority,
|
TCertificateAuthority,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { caKeys } from "../ca/queries";
|
import { caKeys } from "../ca/queries";
|
||||||
import { workspaceKeys } from "../workspace/queries";
|
import { workspaceKeys } from "../workspace";
|
||||||
import { certTemplateKeys } from "./queries";
|
import { certTemplateKeys } from "./queries";
|
||||||
import {
|
import {
|
||||||
TCertificateTemplate,
|
TCertificateTemplate,
|
||||||
@@ -54,7 +54,9 @@ export const useDeleteCertTemplate = () => {
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
return useMutation<TCertificateTemplate, {}, TDeleteCertificateTemplateDTO>({
|
return useMutation<TCertificateTemplate, {}, TDeleteCertificateTemplateDTO>({
|
||||||
mutationFn: async (data) => {
|
mutationFn: async (data) => {
|
||||||
const { data: certificateTemplate } = await apiRequest.delete<TCertificateTemplate>(`/api/v1/pki/certificate-templates/${data.id}`);
|
const { data: certificateTemplate } = await apiRequest.delete<TCertificateTemplate>(
|
||||||
|
`/api/v1/pki/certificate-templates/${data.id}`
|
||||||
|
);
|
||||||
return certificateTemplate;
|
return certificateTemplate;
|
||||||
},
|
},
|
||||||
onSuccess: ({ caId }, { projectId, id }) => {
|
onSuccess: ({ caId }, { projectId, id }) => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|||||||
|
|
||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { workspaceKeys } from "../workspace/queries";
|
import { workspaceKeys } from "../workspace";
|
||||||
import { TCertificate, TDeleteCertDTO, TRevokeCertDTO } from "./types";
|
import { TCertificate, TDeleteCertDTO, TRevokeCertDTO } from "./types";
|
||||||
|
|
||||||
export const useDeleteCert = () => {
|
export const useDeleteCert = () => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|||||||
|
|
||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { workspaceKeys } from "../workspace/queries";
|
import { workspaceKeys } from "../workspace";
|
||||||
import {
|
import {
|
||||||
App,
|
App,
|
||||||
BitBucketWorkspace,
|
BitBucketWorkspace,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|||||||
import { createNotification } from "@app/components/notifications";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { workspaceKeys } from "../workspace/queries";
|
import { workspaceKeys } from "../workspace";
|
||||||
import { TCloudIntegration } from "./types";
|
import { TCloudIntegration } from "./types";
|
||||||
|
|
||||||
export const integrationQueryKeys = {
|
export const integrationQueryKeys = {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|||||||
|
|
||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { workspaceKeys } from "../workspace/queries";
|
import { workspaceKeys } from "../workspace";
|
||||||
import { pkiAlertKeys } from "./queries";
|
import { pkiAlertKeys } from "./queries";
|
||||||
import { TCreatePkiAlertDTO, TDeletePkiAlertDTO, TPkiAlert, TUpdatePkiAlertDTO } from "./types";
|
import { TCreatePkiAlertDTO, TDeletePkiAlertDTO, TPkiAlert, TUpdatePkiAlertDTO } from "./types";
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|||||||
|
|
||||||
import { apiRequest } from "@app/config/request";
|
import { apiRequest } from "@app/config/request";
|
||||||
|
|
||||||
import { workspaceKeys } from "../workspace/queries";
|
import { workspaceKeys } from "../workspace";
|
||||||
import { pkiCollectionKeys } from "./queries";
|
import { pkiCollectionKeys } from "./queries";
|
||||||
import {
|
import {
|
||||||
TAddItemToPkiCollectionDTO,
|
TAddItemToPkiCollectionDTO,
|
||||||
@@ -11,7 +11,8 @@ import {
|
|||||||
TPkiCollection,
|
TPkiCollection,
|
||||||
TPkiCollectionItem,
|
TPkiCollectionItem,
|
||||||
TRemoveItemFromPkiCollectionDTO,
|
TRemoveItemFromPkiCollectionDTO,
|
||||||
TUpdatePkiCollectionTO} from "./types";
|
TUpdatePkiCollectionTO
|
||||||
|
} from "./types";
|
||||||
|
|
||||||
export const useCreatePkiCollection = () => {
|
export const useCreatePkiCollection = () => {
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { NextRouter, useRouter } from "next/router";
|
|||||||
import { useServerConfig } from "@app/context";
|
import { useServerConfig } from "@app/context";
|
||||||
import { useSelectOrganization } from "@app/hooks/api";
|
import { useSelectOrganization } from "@app/hooks/api";
|
||||||
import { fetchOrganizations } from "@app/hooks/api/organization/queries";
|
import { fetchOrganizations } from "@app/hooks/api/organization/queries";
|
||||||
import { userKeys } from "@app/hooks/api/users/queries";
|
import { userKeys } from "@app/hooks/api/users";
|
||||||
import { queryClient } from "@app/reactQuery";
|
import { queryClient } from "@app/reactQuery";
|
||||||
|
|
||||||
export const navigateUserToOrg = async (router: NextRouter, organizationId?: string) => {
|
export const navigateUserToOrg = async (router: NextRouter, organizationId?: string) => {
|
||||||
|
|||||||
+2
-1
@@ -91,7 +91,8 @@ export const AddMemberModal = ({ popUp, handlePopUpToggle }: Props) => {
|
|||||||
organizationRoleSlug: ProjectMembershipRole.Member, // ? This doesn't apply in this case, because we know the users being added are already part of the organization
|
organizationRoleSlug: ProjectMembershipRole.Member, // ? This doesn't apply in this case, because we know the users being added are already part of the organization
|
||||||
projects: [
|
projects: [
|
||||||
{
|
{
|
||||||
id: workspaceId,
|
slug: currentWorkspace.slug,
|
||||||
|
id: currentWorkspace.id,
|
||||||
projectRoleSlug: projectRoleSlugs
|
projectRoleSlug: projectRoleSlugs
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user