Now using jwt stuff...
This commit is contained in:
parent
fe43a2212a
commit
f4ec2fe472
|
@ -1,13 +1,10 @@
|
|||
import axios from 'axios';
|
||||
const config = {
|
||||
username: 'niggl',
|
||||
password: '9VEBc596T7tiPB7mNJukfeH9LfGzrrJN'
|
||||
};
|
||||
import UserStore from './UserStore';
|
||||
export default class Apiclient {
|
||||
static async getStats() {
|
||||
return (
|
||||
await axios.get('https://kauft.es/api/stats', {
|
||||
auth: config
|
||||
headers: { Authorization: `Bearer ${UserStore.state.token}` }
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
@ -15,7 +12,7 @@ export default class Apiclient {
|
|||
static async getUrls() {
|
||||
return (
|
||||
await axios.get('https://kauft.es/api?showVisits=true', {
|
||||
auth: config
|
||||
headers: { Authorization: `Bearer ${UserStore.state.token}` }
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
@ -23,7 +20,7 @@ export default class Apiclient {
|
|||
static async getUrlDetails(shortcode) {
|
||||
return (
|
||||
await axios.get(`https://kauft.es/api/${shortcode}`, {
|
||||
auth: config
|
||||
headers: { Authorization: `Bearer ${UserStore.state.token}` }
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
@ -31,7 +28,7 @@ export default class Apiclient {
|
|||
static async getUrlVisits(shortcode) {
|
||||
return (
|
||||
await axios.get(`https://kauft.es/api/${shortcode}/visits`, {
|
||||
auth: config
|
||||
headers: { Authorization: `Bearer ${UserStore.state.token}` }
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
@ -39,7 +36,7 @@ export default class Apiclient {
|
|||
static async deleteUrl(shortcode) {
|
||||
return (
|
||||
await axios.delete(`https://kauft.es/api/${shortcode}`, {
|
||||
auth: config
|
||||
headers: { Authorization: `Bearer ${UserStore.state.token}` }
|
||||
})
|
||||
).status;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue