diff --git a/flutter_client/lib/api/endpoints/quarantine.dart b/flutter_client/lib/api/endpoints/quarantine.dart new file mode 100644 index 00000000..5568e222 --- /dev/null +++ b/flutter_client/lib/api/endpoints/quarantine.dart @@ -0,0 +1,25 @@ +import 'package:dio/dio.dart'; + +/// /api/quarantine — flag a track (with reason + optional notes) and +/// unflag it. Both endpoints are user-scoped: callers can only flag +/// their own quarantine entries; admins use a separate /admin/quarantine +/// surface. +class QuarantineApi { + QuarantineApi(this._dio); + final Dio _dio; + + /// POST /api/quarantine. Server returns 201 with the row. + /// Reason values: bad_rip | wrong_file | wrong_tags | duplicate | other. + Future flag(String trackId, String reason, {String notes = ''}) async { + await _dio.post('/api/quarantine', data: { + 'track_id': trackId, + 'reason': reason, + 'notes': notes, + }); + } + + /// DELETE /api/quarantine/{track_id}. Server returns 204. + Future unflag(String trackId) async { + await _dio.delete('/api/quarantine/$trackId'); + } +}