api integration

This commit is contained in:
2025-06-02 10:29:32 +05:30
parent 7c9e089c62
commit 805aa5e015
289 changed files with 40017 additions and 1082 deletions

View File

@@ -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(),
);

View File

@@ -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();