updateForm method

Future<FormModel> updateForm(
  1. String formId,
  2. FormModel form
)

Updates an existing form.

Makes a PUT /form/:formId request.

formId is the unique ID of the form to update. form is the FormModel with updated data.

Returns the updated FormModel.

Throws DioException on failure.

Implementation

Future<FormModel> updateForm(String formId, FormModel form) async {
  final response = await client.dio.put('/form/$formId', data: form.toJson());
  return FormModel.fromJson(response.data as Map<String, dynamic>);
}