forked from eatvio/eatvio_app
feat(diary): add gallery
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:eatvio_app/features/diary/models/diary_day_model.dart';
|
||||
import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart';
|
||||
import 'package:eatvio_app/features/diary/repositories/diary_repository.dart';
|
||||
import 'package:eatvio_app/features/glossary/models/glossary_model.dart';
|
||||
@@ -78,4 +81,32 @@ class DiaryCubit extends Cubit<DiaryState> {
|
||||
Future<List<GlossaryModel>> getGlossaryListByQuery(String query) async {
|
||||
return await glossaryRepository.getGlossaryListByQuery(query);
|
||||
}
|
||||
|
||||
uploadPhotos({
|
||||
required List<File> files,
|
||||
required int diaryId,
|
||||
required int mealId,
|
||||
required String date,
|
||||
}) async {
|
||||
await diaryRepository.uploadPhotos(
|
||||
files: files,
|
||||
diaryId: diaryId,
|
||||
mealId: mealId,
|
||||
);
|
||||
await getDiaryDay(date, false);
|
||||
}
|
||||
|
||||
deletePhoto({
|
||||
required DiaryPhotoModel photo,
|
||||
required int diaryId,
|
||||
required int mealId,
|
||||
required String date,
|
||||
}) async {
|
||||
await diaryRepository.deletePhoto(
|
||||
photo: photo,
|
||||
diaryId: diaryId,
|
||||
mealId: mealId,
|
||||
);
|
||||
await getDiaryDay(date, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user