patchSubmission method
Partially updates a submission (PATCH).
formPath is the full path to the form.
submissionId is the ID of the submission to update.
data contains only the fields to update.
Throws SubmissionException on error.
Implementation
Future<SubmissionModel> patchSubmission(
String formPath,
String submissionId,
Map<String, dynamic> data,
) async {
try {
final url = ApiEndpoints.patchSubmission(formPath, submissionId);
final response = await client.dio.patch(
url,
data: {'data': data},
);
return SubmissionModel.fromJson(response.data ?? {});
} catch (e) {
throw SubmissionException('Failed to patch submission: $e');
}
}