using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Net;
using models;
using services;
using UnityEngine;

public class PocketBaseDataRepository : MonoBehaviour
{

    [SerializeField] public String userToken;
    [SerializeField] public Trash[] trashes;

    void Start()
    {
        LoginResponse res = UserService.Login(new LoginRequest("************", "**********"));
        this.userToken = res.token;

        TrashList list = TrashService.ListTrash(this.userToken);
        foreach (Trash trash in list.items)
        {
            Debug.Log(trash.id);
            DataList trashData = TrashService.ListTrashData(userToken, trash.id);
            trash.data = trashData.items;
        }
        this.trashes = list.items;
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
