Skip to content

Commit

Permalink
Merge pull request #1800 from iFixit/troubleshooting-use--guide-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jarstelfox authored Jul 6, 2023
2 parents 1e75003 + f744fac commit 308fc4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type Problem = {
};

export type ApiSolutionSection = Section & {
guides: number[];
guides: Guide[];
products: string[];
};

Expand Down
14 changes: 1 addition & 13 deletions frontend/templates/troubleshooting/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
ApiSolutionSection,
SolutionSection,
} from './hooks/useTroubleshootingProps';
import { Guide } from './hooks/GuideModel';
import Product from '@pages/api/nextjs/cache/product';
import type { Product as ProductType } from '@models/product';
import {
Expand Down Expand Up @@ -56,16 +55,6 @@ export const getServerSideProps: GetServerSideProps<TroubleshootingProps> =
async function fetchDataForSolution(
solution: ApiSolutionSection
): Promise<SolutionSection> {
const guides = await Promise.all(
solution.guides.map((guideid: number) => {
return (
client.get(`guides/${guideid}`, 'guide') as Promise<Guide>
).catch((error) => {
rethrowUnless404(error);
return null;
});
})
);
const products: ('' | null | ProductType)[] = await Promise.all(
solution.products.map((handle: string | null) => {
return (
Expand All @@ -86,7 +75,6 @@ export const getServerSideProps: GetServerSideProps<TroubleshootingProps> =
);
return {
...solution,
guides: guides.filter((guide): guide is Guide => Boolean(guide)),
products: products.filter((product): product is ProductType =>
Boolean(product)
),
Expand All @@ -96,7 +84,7 @@ export const getServerSideProps: GetServerSideProps<TroubleshootingProps> =
let troubleshootingData: TroubleshootingApiData;
try {
troubleshootingData = await client.get<TroubleshootingApiData>(
`Troubleshooting/${wikiname}?vulcan=1`,
`Troubleshooting/${wikiname}?vulcan=1&fullGuides=1`,
'troubleshooting'
);
} catch (e) {
Expand Down

2 comments on commit 308fc4c

@vercel
Copy link

@vercel vercel bot commented on 308fc4c Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-commerce – ./frontend

react-commerce-git-main-ifixit.vercel.app
react-commerce-ifixit.vercel.app
react-commerce.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 308fc4c Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-commerce-prod – ./frontend

react-commerce-prod-ifixit.vercel.app
react-commerce-prod-git-main-ifixit.vercel.app
react-commerce-prod.vercel.app

Please sign in to comment.