Skip to content

Commit fddbd6b

Browse files
committed
search api endpoint fix for S3
1 parent 1555d3c commit fddbd6b

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

src/features/search/api/get-search-posts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('getAllPostsForSearch (api)', () => {
1414

1515
const posts = await getAllPostsForSearch()
1616

17-
expect(mockFetch).toHaveBeenCalledWith('/api/posts-search/', {
17+
expect(mockFetch).toHaveBeenCalledWith('/api/posts-search.json', {
1818
headers: { 'Content-Type': 'application/json' }
1919
})
2020
expect(posts).toEqual([

src/features/search/api/get-search-posts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { SearchResultItem } from '../types'
22

33
export async function getAllPostsForSearch(): Promise<SearchResultItem[]> {
4-
const posts = await fetch('/api/posts-search/', {
4+
const posts = await fetch('/api/posts-search.json', {
55
headers: { 'Content-Type': 'application/json' }
66
})
77
const json = (await posts.json()) as SearchResultItem[]
File renamed without changes.

test/e2e/header.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ test('search ui is working', async ({ page }) => {
4242
const emptyMessage = 'Awaiting your input fellow web wanderer'
4343

4444
// Mock the api call before search
45-
await page.route('*/**/api/posts-search/', async (route) => {
45+
await page.route('*/**/api/posts-search.json', async (route) => {
4646
const json = [
4747
{ data: { title: 'MomCorp Wallpaper' }, slug: 'momcorp-wallpaper' }
4848
]

0 commit comments

Comments
 (0)