api integration
This commit is contained in:
@@ -12,7 +12,7 @@ class AuthService {
|
||||
Future<AuthToken> login(AuthCredentials credentials) async {
|
||||
try {
|
||||
final response = await _dio.post(
|
||||
'/login',
|
||||
'/api/auth/login',
|
||||
data: credentials.toJson(),
|
||||
);
|
||||
|
||||
|
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:kmobile/data/models/user.dart';
|
||||
@@ -6,10 +8,11 @@ class UserService {
|
||||
final Dio _dio;
|
||||
UserService(this._dio);
|
||||
|
||||
Future<List<User>> getUserDetails(String customerNo) async {
|
||||
Future<List<User>> getUserDetails() async {
|
||||
try {
|
||||
final response = await _dio.get('/customer/details');
|
||||
final response = await _dio.get('/api/customer/details');
|
||||
if (response.statusCode == 200) {
|
||||
log('Response: ${response.data}');
|
||||
return (response.data as List)
|
||||
.map((user) => User.fromJson(user))
|
||||
.toList();
|
Reference in New Issue
Block a user