Implemented basic api getting and deletion

This commit is contained in:
2021-08-16 16:47:15 +02:00
parent 91572bd24e
commit ca09aa0fd5
3 changed files with 72 additions and 41 deletions

18
src/lib/Apiclient.js Normal file
View File

@@ -0,0 +1,18 @@
import axios from 'axios';
const config = {
username: "niggl",
password: "9VEBc596T7tiPB7mNJukfeH9LfGzrrJN"
}
export default class Apiclient {
static async getUrls() {
return (await axios.get("https://kauft.es/api?showVisits=true", {
auth: config
})).data
}
static async deleteUrl(shortcode) {
return (await axios.delete(`https://kauft.es/api/${shortcode}`, {
auth: config
})).status
}
}