Added new apiclient functions
This commit is contained in:
parent
42ec4df093
commit
4338ee2a98
|
@ -1,7 +1,7 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
const config = {
|
const config = {
|
||||||
username: "niggl",
|
username: "niggl",
|
||||||
password: "9VEBc596T7tiPB7mNJukfeH9LfGzrrJN"
|
password: "niggl"
|
||||||
}
|
}
|
||||||
export default class Apiclient {
|
export default class Apiclient {
|
||||||
static async getUrls() {
|
static async getUrls() {
|
||||||
|
@ -10,6 +10,18 @@ export default class Apiclient {
|
||||||
})).data
|
})).data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async getUrlDetails(shortcode) {
|
||||||
|
return (await axios.get(`https://kauft.es/api/${shortcode}`, {
|
||||||
|
auth: config
|
||||||
|
})).data
|
||||||
|
}
|
||||||
|
|
||||||
|
static async getUrlVisits(shortcode) {
|
||||||
|
return (await axios.get(`https://kauft.es/api/${shortcode}/visits`, {
|
||||||
|
auth: config
|
||||||
|
})).data
|
||||||
|
}
|
||||||
|
|
||||||
static async deleteUrl(shortcode) {
|
static async deleteUrl(shortcode) {
|
||||||
return (await axios.delete(`https://kauft.es/api/${shortcode}`, {
|
return (await axios.delete(`https://kauft.es/api/${shortcode}`, {
|
||||||
auth: config
|
auth: config
|
||||||
|
|
Loading…
Reference in New Issue