legacy/pairent_frontend_react/src/API/ApartamentService.js

26 lines
710 B
JavaScript

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;
}
static async getComparisons() {
const response = await axios.get(API_ROOT + '/api/comparison/')
return response;
}
}