fix daphne deployment
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// const String baseURL = "https://groceries.alaevens.ca";
|
||||
const String baseURL = "http://192.168.0.16:8000";
|
||||
const String baseWsURL = "ws://192.168.0.16:8000";
|
||||
const String baseURL = "https://groceries.alaevens.ca";
|
||||
const String baseWsURL = "wss://groceries.alaevens.ca";
|
||||
// const String baseURL = "http://192.168.0.16:8000";
|
||||
// const String baseWsURL = "ws://192.168.0.16:8000";
|
||||
|
||||
const int resultsPerPage = 4;
|
||||
|
||||
@@ -29,12 +29,15 @@ class SimpleUser {
|
||||
});
|
||||
|
||||
factory SimpleUser.fromJson(Map<String, dynamic> json) {
|
||||
String? imagePath = json["image"] as String?;
|
||||
String? imageUrl = imagePath != null ? "$baseURL/media/$imagePath" : null;
|
||||
|
||||
return SimpleUser(
|
||||
id: json["id"] as int,
|
||||
username: json["username"] as String,
|
||||
firstName: json["first_name"] as String,
|
||||
lastName: json["last_name"] as String,
|
||||
imageUrl: json["image"] as String?,
|
||||
imageUrl: imageUrl,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,13 +28,16 @@ class User {
|
||||
List<dynamic> invitesDynamic = json["homegroup_invites"];
|
||||
List<int> invites = invitesDynamic.map((e) => e as int).toList();
|
||||
|
||||
String? imagePath = json["image"] as String?;
|
||||
String? imageUrl = imagePath != null ? "$baseURL/media/$imagePath" : null;
|
||||
|
||||
return User(
|
||||
id: json["id"] as int,
|
||||
username: json["username"] as String,
|
||||
firstName: json["first_name"] as String,
|
||||
lastName: json["last_name"] as String,
|
||||
homegroup: json["homegroup"] as int?,
|
||||
imageUrl: json["image"] as String?,
|
||||
imageUrl: imageUrl,
|
||||
homegroupInvites: invites,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user