updateSubmission method
Updates an existing submission (full replace).
formPath is the full path to the form.
submissionId is the ID of the submission to update.
data is the complete updated form data.
Throws SubmissionException on error.
Implementation
Future<SubmissionModel> updateSubmission(
String formPath,
String submissionId,
Map<String, dynamic> data,
) async {
try {
final url = ApiEndpoints.updateSubmission(formPath, submissionId);
final response = await client.dio.put(
url,
data: {'data': data},
);
return SubmissionModel.fromJson(response.data ?? {});
} catch (e) {
throw SubmissionException('Failed to update submission: $e');
}
}