import axios from 'axios'; 
import constants from '../constants';

const { API_ROOT } = constants;

export default class ApartamentService {
    static async getAll(limit, offest) {
        const response = await axios.get(API_ROOT + '/api/apartaments/', {
            params: {
                limit: limit,
                ...(offest !== 0 ? {offset: offest} : {})
            }
        })
        return response;
    }

    static async getById(id) {
        const response = await axios.get(API_ROOT + '/api/apartament/' + id)
        return response;
    }
}