Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/tutor-pro/assets/lib/tutor-formdata.js

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + /**
2 + * Creates FormData object from array of data objects
3 + * @deprecated This function is deprecated and will be removed in a future version
4 + * @param {Array} data - Array of objects to convert to FormData
5 + * @returns {FormData} FormData object with nonce data included
6 + */
7 + function tutorFormData(data = []) {
8 + const formData = new FormData();
9 + data.forEach((item) => {
10 + for (const [key, value] of Object.entries(item)) {
11 + formData.set(key, value)
12 + }
13 + });
14 + formData.set(window.tutor_get_nonce_data(true).key, window.tutor_get_nonce_data(true).value);
15 + return formData;
16 + }
17 + export default tutorFormData;