11 lines
333 B
Dart
11 lines
333 B
Dart
import 'package:sweet_chat_app/models/user.dart';
|
|
import 'package:sweet_chat_app/services/dio_service.dart';
|
|
|
|
Future<List<User>> getUserFriendsApi(int userId) async {
|
|
final res = await dioService.get('/user/friend/$userId');
|
|
|
|
if (res.data == null) return [];
|
|
|
|
return (res.data as List).map((e) => User.fromJson(e)).toList();
|
|
}
|