Skip to content

Commit

Permalink
fix: fixes and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Jul 21, 2023
1 parent 16d72a9 commit 90c17a4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/core/src/data/strategies/PostOrPostsFetchStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class PostOrPostsFetchStrategy<
} as R,
};
} catch (e) {
console.log(e);

Check warning on line 89 in packages/core/src/data/strategies/PostOrPostsFetchStrategy.ts

View workflow job for this annotation

GitHub Actions / eslint (16.x)

Unexpected console statement
// do nothing
}

Expand Down Expand Up @@ -123,6 +124,7 @@ export class PostOrPostsFetchStrategy<
} as R,
};
} catch (e) {
console.log('archive not found', e);

Check warning on line 127 in packages/core/src/data/strategies/PostOrPostsFetchStrategy.ts

View workflow job for this annotation

GitHub Actions / eslint (16.x)

Unexpected console statement
// do nothing
}

Expand Down
1 change: 1 addition & 0 deletions packages/next/src/data/server/fetchHookData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export async function fetchHookData<T = unknown, P extends EndpointParams = Endp
const stringPath = convertToPath(path);
const defaultParams = fetchStrategy.getDefaultParams();
const urlParams = fetchStrategy.getParamsFromURL(stringPath, params);

const finalParams = deepmerge.all([defaultParams, urlParams, params]) as Partial<P>;

// we don't want to include the preview params in the key
Expand Down
6 changes: 1 addition & 5 deletions projects/wp-nextjs/src/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ export const searchParams = { postType: 'post' };
export const blogParams = {
single: {
postType: 'post',
/**
* Specifying the _fields param reduces the amount of data queried and returned by the API.
*/
_fields: ['id', 'title', 'link'],
},
archive: {
postType: 'post',
Expand All @@ -31,7 +27,7 @@ export const blogParams = {
*/
_fields: ['id', 'title', 'link'],
},
priority: 'archive',
priority: 'single',
};

// The params below are just for the custom post type routes example
Expand Down

0 comments on commit 90c17a4

Please sign in to comment.