Fichtelgard

FormData from Object-Keys

export async function getFormDataByObjectKeys(
object: Object
): Promise {
let formData = new FormData();

Object.entries(object).forEach((key: any) => {
if (key[1] && key[1] !== undefined && key.length) {
formData.append(key[0], key[1]);
}
});

return formData;
}