Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-84777

Provide utility to convert JavaScript objects to FormData instances

    Details

      Description

      In several places, we're using `fetch` requests to asynchronously request some information or execute specific actions rather than forcing a full page refresh.

      For that purpose, PortletBase includes a fetch method that internally calls a utility that converts objects to FormData for proper submission. 

      The current implementation doesn't support some types of native objects like:

      • Array
      • File
      • Object

      We want to extract this as a general utility that can be reused whenever fetch expects a custom FormData.

       
      based: https://gist.github.com/rddimon/af66932bc2e799606c5da912be3e6ea6
      ideas: https://github.com/therealparmesh/object-to-formdata

        Attachments

          Activity

            People

            • Assignee:
              brian.chan Brian Chan
              Reporter:
              jose.balsas Chema Balsas
              Recent user:
              Csaba Turcsan
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                7.1.10 DXP FP3
                7.1.1 CE GA2
                7.1.10.1 SP1
                7.1.X
                Master