Prepare apiService for base url.
This commit is contained in:
parent
2147807fa0
commit
fd4cd6d687
@ -15,6 +15,12 @@ const MEDIA_UPLOAD_URL = '/api/statusnet/media/upload'
|
|||||||
// import { param, ajax } from 'jquery';
|
// import { param, ajax } from 'jquery';
|
||||||
// import { merge } from 'lodash';
|
// import { merge } from 'lodash';
|
||||||
|
|
||||||
|
let fetch = (url, options) => {
|
||||||
|
const baseUrl = ''
|
||||||
|
const fullUrl = baseUrl + url
|
||||||
|
return window.fetch(fullUrl, options)
|
||||||
|
}
|
||||||
|
|
||||||
const authHeaders = (user) => {
|
const authHeaders = (user) => {
|
||||||
if (user) {
|
if (user) {
|
||||||
return { 'Authorization': `Basic ${btoa(`${user.username}:${user.password}`)}` }
|
return { 'Authorization': `Basic ${btoa(`${user.username}:${user.password}`)}` }
|
||||||
|
Loading…
Reference in New Issue
Block a user