From 839c65807524646c1c6a677f10042988fb2bccdf Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sat, 21 Aug 2021 10:12:06 +0200 Subject: [PATCH] Added apiclient method --- src/lib/Apiclient.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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