added diet complaints and token interceptor for auth handling

This commit is contained in:
Username1548
2025-03-05 17:25:07 +07:00
parent 0c448240f2
commit ede59d0477
14 changed files with 180 additions and 112 deletions

View File

@@ -319,9 +319,11 @@ class _ViolenceAndHostilityState extends State<_ViolenceAndHostility> {
});
},
),
Text(
element.$2,
style: TextStyles.textLSemibold.copyWith(color: appTheme.black),
Expanded(
child: Text(
element.$2,
style: TextStyles.textLSemibold.copyWith(color: appTheme.black),
),
),
],
);

View File

@@ -43,8 +43,11 @@ class ComplainingCubit extends Cubit<ComplainingState> {
if (category != null && contentType != null) {
switch (contentType) {
case ComplainedContent.diet:
emit(state.copyWith(wasSentSuccessfully: true));
return;
if (id != null) {
await repository.sendDietComplain(id: id, category: category.getValue(), body: state.complainInfo);
emit(state.copyWith(wasSentSuccessfully: true));
return;
}
case ComplainedContent.plan:
if (slug != null) {
await repository.sendPlanComplain(slug: slug, category: category.getValue(), body: state.complainInfo);