setMainImage method

Future setMainImage({
  1. required ApiRequest apiRequest,
})

Set an image as the main image

Implementation

Future setMainImage({required ApiRequest apiRequest}) async {
  FormData formData = FormData();

  if (apiRequest.postData != null) {
    formData.fields
        .add(MapEntry(apiRequest.postDataKey, apiRequest.postData));
  }

  /// setup the API for the request
  _setupApiFromRequest(apiRequest);

  return await network(
    request: (api) => api.request("/", data: formData),
  );
}