diff --git a/src/lib/Apiclient.js b/src/lib/Apiclient.js index 84b024e..70f9104 100644 --- a/src/lib/Apiclient.js +++ b/src/lib/Apiclient.js @@ -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