-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update role.dart #146
Update role.dart #146
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,27 +3,23 @@ part of appwrite; | |
class Role { | ||
Role._(); | ||
|
||
static String any() { | ||
return 'any'; | ||
} | ||
|
||
static String user(String id, [String status = '']) { | ||
static String any() => 'any'; | ||
String status=''; | ||
static String user(String id, status]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't want to do this because this makes status required. |
||
if(status.isEmpty) { | ||
return 'user:$id'; | ||
} | ||
return 'user:$id/$status'; | ||
} | ||
|
||
static String users([String status = '']) { | ||
static String users(status]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, status shouldn't be required. In addition, there's an extra bracket here and missing type. |
||
if(status.isEmpty) { | ||
return 'users'; | ||
} | ||
return 'users/$status'; | ||
} | ||
|
||
static String guests() { | ||
return 'guests'; | ||
} | ||
static String guests() => 'guests'; | ||
|
||
static String team(String id, [String role = '']) { | ||
if(role.isEmpty) { | ||
|
@@ -35,4 +31,4 @@ class Role { | |
static String member(String id) { | ||
return 'member:$id'; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't really make sense to add this as a instance attribute since you never instantiate a Role object..