Added apiclient method

This commit is contained in:
Nicolai Ort 2021-08-21 10:12:06 +02:00
parent 12aa8eeb3e
commit 839c658075
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
1 changed files with 12 additions and 0 deletions

View File

@ -62,6 +62,18 @@ export default class Apiclient {
).data;
}
/**
* API-Getter for the linkylinky api all vists endpoint (needs auth)
* @returns Url visit details for each visit in an array of objects.
*/
static async getVisits() {
return (
await axios.get(`https://kauft.es/api/visits`, {
headers: { Authorization: `Bearer ${UserStore.state.token}` }
})
).data;
}
/**
* API-Delet for the linkylinky api url deletion endpoint (needs auth)
* @param {*} shortcode The shortcode of your most hated url