updateVariable method

Future<Response> updateVariable(
  1. String id, {
  2. required String key,
  3. required String value,
  4. String? projectId,
})

Update a variable by ID

Implementation

Future<Response> updateVariable(String id, {
  required String key,
  required String value,
  String? projectId,
}) async {
  try {
    final response = await _dio.put(
      '/variables/$id',
      data: {
        'key': key,
        'value': value,
        if (projectId != null) 'projectId': projectId,
      },
    );
    return response;
  } on DioException catch (e) {
    throw Exception('Failed to update variable: ${e.message}');
  }
}