Skip to content

Commit

Permalink
#14 Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
krckyboy committed Feb 11, 2024
1 parent aeb204d commit 7ae93ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions next/src/scripts/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const db = {
page: 1
}
};

const queryString = qs.stringify(queryParams);
return await fetchWrapper<PostsFetchResponse>(`/posts?${queryString}`);
},
Expand All @@ -41,13 +42,15 @@ export const db = {
},
populate: ['categories']
};

const queryString = qs.stringify(queryParams);
return await fetchWrapper<PostsFetchResponse>(`/posts?${queryString}`);
},
getPostSlugs: async () => {
const queryParams = {
fields: ['slug']
};

const queryString = qs.stringify(queryParams);
return await fetchWrapper<PostsFetchResponse>(`/posts?${queryString}`);
},
Expand All @@ -61,6 +64,7 @@ export const db = {
sort: ['publishedAt:desc'],
fields: ['slug', 'title', 'content', 'publishedAt']
};

const queryString = qs.stringify(queryParams);
return await fetchWrapper<PostsFetchResponse>(`/posts?${queryString}`);
},
Expand Down

0 comments on commit 7ae93ff

Please sign in to comment.