Skip to content

Commit

Permalink
don't cache POEditor API response
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Oct 2, 2024
1 parent 6c89db7 commit 529e940
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion layouts/shortcodes/poeditorTranslations.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
{{ $url := "https://api.poeditor.com/v2/languages/list" }}
{{ $body := printf "api_token=%s&id=%s" $apiToken $projectId | safeURL }}
{{ $headers := dict "Content-Type" "application/x-www-form-urlencoded" }}
{{ $cacheBuster := now.Unix }}

{{ $response := resources.GetRemote $url (dict "method" "POST" "body" $body "headers" $headers) }}

{{ $response := resources.GetRemote (printf "%s?cache-buster=%d" $url $cacheBuster) (dict "method" "POST" "body" $body "headers" $headers) }}

{{ if $response }}
{{ with $response.Err }}
Expand Down

0 comments on commit 529e940

Please sign in to comment.