This repository has been archived on 2021-03-10. You can view files and clone it, but cannot push or open issues or pull requests.
perktree/frontend/src/apis/perk.api.js

29 lines
475 B
JavaScript

/*
* perk.api.js
* Copyright (C) 2019 pavle <pavle.portic@tilda.center>
*
* Distributed under terms of the BSD-3-Clause license.
*/
import Axios from 'axios';
const ENDPOINTS = {
TREES: '/trees',
PERKS: '/perks',
};
export default class AuthApi {
static getTrees() {
return Axios.get(ENDPOINTS.TREES);
}
static getPerks(tree) {
return Axios.get(ENDPOINTS.TREES + `/${tree}`);
}
static uploadPerks(data) {
return Axios.put(ENDPOINTS.TREES, data);
}
}