feat(recipes): add recipe visibility and sharing features
- Implemented functionality to set recipe visibility (public/private) with appropriate checks for user permissions. - Added ability to share recipes with other users, including validation for existing users and permissions. - Introduced new DTOs for setting visibility and sharing recipes. - Updated RecipesController and RecipesService to handle new endpoints for visibility and sharing. - Enhanced inventory preview to consider user permissions and shared recipes. - Updated front-end to support new sharing and visibility features, including UI changes for recipe detail and admin user management.
This commit is contained in:
@@ -7,6 +7,7 @@ class UserAdmin {
|
||||
final String? lastName;
|
||||
final String role;
|
||||
final bool isPremium;
|
||||
final bool canShareRecipes;
|
||||
final DateTime? createdAt;
|
||||
|
||||
const UserAdmin({
|
||||
@@ -17,6 +18,7 @@ class UserAdmin {
|
||||
this.lastName,
|
||||
required this.role,
|
||||
required this.isPremium,
|
||||
required this.canShareRecipes,
|
||||
this.createdAt,
|
||||
});
|
||||
|
||||
@@ -28,6 +30,7 @@ class UserAdmin {
|
||||
lastName: json['lastName'] as String?,
|
||||
role: json['role'] as String? ?? 'user',
|
||||
isPremium: json['isPremium'] as bool? ?? false,
|
||||
canShareRecipes: json['canShareRecipes'] as bool? ?? true,
|
||||
createdAt: json['createdAt'] != null ? DateTime.tryParse(json['createdAt'] as String) : null,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user