Skip to content

Commit

Permalink
refactor: use form data
Browse files Browse the repository at this point in the history
  • Loading branch information
kielllll committed Oct 28, 2024
1 parent 04182e2 commit 7f92069
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/assets/js/react/api/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ export function apiPostUpdateSelectBox () {
* @since 5.2
*/
export function apiPostTemplateProcessing (templateId) {
const formData = new FormData()
formData.append('action', 'gfpdf_delete_template')
formData.append('nonce', GFPDF.ajaxNonce)
formData.append('id', templateId)

return fetch(GFPDF.ajaxUrl, {
method: 'POST',
body: JSON.stringify({
action: 'gfpdf_delete_template',
nonce: GFPDF.ajaxNonce,
id: templateId
})
body: formData
})
}

Expand Down

0 comments on commit 7f92069

Please sign in to comment.