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