Skip to content

Commit

Permalink
make typescript happy
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou committed Feb 10, 2023
1 parent 5c899c3 commit 03e723e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/consulting/api/types/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ export type LinksQuery = {
slug: string | null;
isFolder: boolean | null;
name: string | null;
parentId: number | null;
}>;
} | null;
};
Expand Down
2 changes: 1 addition & 1 deletion apps/consulting/api/utils/getLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LinksDocument } from '../types/hooks';
import { LinksQuery } from '../types/operations';

export const getLinks = async (): Promise<
Pick<LinkEntry, 'id' | 'isFolder' | 'name' | 'slug'>[]
Pick<LinkEntry, 'id' | 'isFolder' | 'name' | 'slug' | 'parentId'>[]
> => {
const { data } = await Api.getLinks<LinksQuery>(LinksDocument);
return data.Links.items;
Expand Down
4 changes: 3 additions & 1 deletion apps/consulting/pages/[slug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export const getStaticPaths: GetStaticPaths = async () => {
const links = await getLinks();
return {
paths:
getPaths<Pick<LinkEntry, 'id' | 'isFolder' | 'name' | 'slug'>>(links),
getPaths<
Pick<LinkEntry, 'id' | 'isFolder' | 'name' | 'slug' | 'parentId'>
>(links),
fallback: false,
};
};
Expand Down
1 change: 1 addition & 0 deletions apps/labs/api/types/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export type LinksQuery = {
slug: string | null;
isFolder: boolean | null;
name: string | null;
parentId: number | null;
}>;
} | null;
};
Expand Down
2 changes: 1 addition & 1 deletion apps/labs/api/utils/getLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LinksDocument } from '../types/hooks';
import { LinksQuery } from '../types/operations';

export const getLinks = async (): Promise<
Pick<LinkEntry, 'id' | 'isFolder' | 'name' | 'slug'>[]
Pick<LinkEntry, 'id' | 'isFolder' | 'name' | 'slug' | 'parentId'>[]
> => {
const { data } = await Api.getLinks<LinksQuery>(LinksDocument);
return data.Links.items;
Expand Down
4 changes: 3 additions & 1 deletion apps/labs/pages/[slug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export const getStaticPaths: GetStaticPaths = async () => {
const links = await getLinks();
return {
paths:
getPaths<Pick<LinkEntry, 'id' | 'isFolder' | 'name' | 'slug'>>(links),
getPaths<
Pick<LinkEntry, 'id' | 'isFolder' | 'name' | 'slug' | 'parentId'>
>(links),
fallback: false,
};
};
Expand Down

0 comments on commit 03e723e

Please sign in to comment.