import 'dart:convert';

import 'package:http/http.dart' as http;

import '../models/permisos_model.dart';

class PermisosProvider{
  final String _url = "smart.solerpalau.mx";

  Future<PermisosModel> fetchPermisos(String dinum, String token) async{
    final url = Uri.https(_url, 'PR/api/v1/quiosco/usuario/permisosApp/$dinum');
    final response = await http.get(url,
        headers: {
          "Authorization" : "Bearer $token"
        }
    );
    final decodedData = jsonDecode(response.body);
    final permisos = PermisosModel.fromJson(decodedData);
    return permisos;
  }
}