forked from eatvio/eatvio_app
80 lines
1.9 KiB
Dart
80 lines
1.9 KiB
Dart
import 'package:eatvio_app/features/complaining/models/complain_model.dart';
|
|
import 'package:eatvio_app/features/complaining/services/complaining_service.dart';
|
|
|
|
class ComplainingRepository {
|
|
final ComplainingService service;
|
|
ComplainingRepository({required this.service});
|
|
|
|
Future<void> sendPlanComplain({
|
|
required String slug,
|
|
required String category,
|
|
required ComplainModel body,
|
|
}) async {
|
|
try {
|
|
await service.sendPlanComplain(slug: slug, category: category, body: body);
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
|
|
Future<void> sendRecipeComplain({
|
|
required String slug,
|
|
required String category,
|
|
required ComplainModel body,
|
|
}) async {
|
|
try {
|
|
await service.sendRecipeComplain(slug: slug, category: category, body: body);
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
|
|
Future<void> sendBlogPostsComplain({
|
|
required int id,
|
|
required String category,
|
|
required ComplainModel body,
|
|
}) async {
|
|
try {
|
|
await service.sendBlogPostsComplain(id: id, category: category, body: body);
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
|
|
Future<void> sendProfileComplain({
|
|
required String slug,
|
|
required String category,
|
|
required ComplainModel body,
|
|
}) async {
|
|
try {
|
|
await service.sendProfileComplain(slug: slug, category: category, body: body);
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
|
|
Future<void> sendDietComplain({
|
|
required int id,
|
|
required String category,
|
|
required ComplainModel body,
|
|
}) async {
|
|
try {
|
|
await service.sendDietComplain(id: id, category: category, body: body);
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
|
|
Future<void> sendCommentComplain({
|
|
required int id,
|
|
required String category,
|
|
required ComplainModel body,
|
|
}) async {
|
|
try {
|
|
await service.sendCommentComplain(id: id, category: category, body: body);
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
}
|