Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalabbad committed Feb 17, 2025
1 parent 3ff3378 commit 201357c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
5 changes: 2 additions & 3 deletions frontend/app/src/entities/diff/api/get-diff-tree-from-api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { DiffTreeQueryFilters } from "@/shared/api/graphql/generated/graphql";
import graphqlClient from "@/shared/api/graphql/graphqlClientApollo";
import { PaginationParams } from "@/shared/api/types";
import { gql } from "@apollo/client";

export const DIFF_TREE_QUERY = gql`
Expand Down Expand Up @@ -127,11 +128,9 @@ export const DIFF_TREE_QUERY = gql`
}
`;

export type GetDiffTreeFromApiParams = {
export type GetDiffTreeFromApiParams = PaginationParams & {
branchName: string;
filters?: DiffTreeQueryFilters;
limit?: number;
offset?: number;
};

export const getDiffTreeFromApi = async ({
Expand Down
5 changes: 2 additions & 3 deletions frontend/app/src/entities/diff/domain/get-diff-tree.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { getDiffTreeFromApi } from "@/entities/diff/api/get-diff-tree-from-api";
import { DiffTree, DiffTreeQueryFilters } from "@/shared/api/graphql/generated/graphql";
import { PaginationParams } from "@/shared/api/types";
import { infiniteQueryOptions, useInfiniteQuery } from "@tanstack/react-query";

export const DIFF_TREE_PER_PAGE = 300;

export type GetDiffTreeParams = {
export type GetDiffTreeParams = PaginationParams & {
branchName: string;
filters?: DiffTreeQueryFilters;
limit?: number;
offset: number;
};

export type GetDiffTree = (params: GetDiffTreeParams) => Promise<DiffTree>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PaginationParams } from "@/shared/api/types";
import { jsonToGraphQLQuery } from "json-to-graphql-query";

export const generateRelationshipListQuery = ({
Expand All @@ -7,11 +8,9 @@ export const generateRelationshipListQuery = ({
offset = 0,
search = "",
peerField,
}: {
}: PaginationParams & {
peer: string;
parent?: { name?: string; value?: string };
limit?: number;
offset?: number;
search?: string;
peerField?: string;
}): string => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { getObjectPermissionsQuery } from "@/entities/permission/queries/getObjectPermissions";
import graphqlClient from "@/shared/api/graphql/graphqlClientApollo";
import { ContextParams } from "@/shared/api/types";
import { gql } from "@apollo/client";

export type GetPermissionsFromApiParams = {
kind: string;
branchName?: string | null;
atDate?: Date | null;
};
export type GetPermissionsFromApiParams = ContextParams & { kind: string };

export const getPermissionsFromApi = ({
kind,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import { Permission } from "@/entities/permission/types";
import { getPermission } from "@/entities/permission/utils";
import { ContextParams } from "@/shared/api/types";

export type GetObjectPermissions = (
args: ContextParams & {
kind: string;
}
) => Promise<Permission>;
export type GetObjectPermissions = (args: ContextParams & { kind: string }) => Promise<Permission>;

export const getObjectPermissions: GetObjectPermissions = async ({ kind, branchName, atDate }) => {
const { data } = await getPermissionsFromApi({ kind, branchName, atDate });
Expand Down

0 comments on commit 201357c

Please sign in to comment.