Skip to content

Commit

Permalink
Update recent-articles.js
Browse files Browse the repository at this point in the history
  • Loading branch information
shrotia committed Oct 15, 2024
1 parent 95817e2 commit fb5a727
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blocks/recent-articles/recent-articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ export default async function decorate(block) {
}

// Fetch metadata if delivery URL is valid
//append current timestamp as a cache killer in the URL e.g. ${deliveryUrl}/metadata?${Date.now()}

Check failure on line 35 in blocks/recent-articles/recent-articles.js

View workflow job for this annotation

GitHub Actions / build

Expected exception block, space or tab after '//' in comment
if (deliveryUrl) {
try {
const response = await fetch(`${deliveryUrl}/metadata`, {
const response = await fetch(`${deliveryUrl}/metadata?${Date.now()}`, {
headers: {
'If-None-Match': 'no-cache' // Set 'no-cache' to ensure the latest metadata is fetched

Check failure on line 40 in blocks/recent-articles/recent-articles.js

View workflow job for this annotation

GitHub Actions / build

Missing trailing comma
}

Check failure on line 41 in blocks/recent-articles/recent-articles.js

View workflow job for this annotation

GitHub Actions / build

Missing trailing comma
Expand Down

0 comments on commit fb5a727

Please sign in to comment.