Beispiel #1
0
	return dispatch => turbo({site_id:APP_ID}).login(credentials)
		.then(data => {
			if (actionType != null){
				dispatch({
					type: actionType,
					data: data
				})
			}

			return data
		})
		.catch(err => {
			throw err
		})
Beispiel #2
0
	return dispatch => turbo({site_id:APP_ID}).remove(resource, entity)
		.then(data => {
			if (actionType != null){
				dispatch({
					type: actionType,
					data: data
				})
			}

			return data
		})
		.catch(err => {
			throw err
		})
Beispiel #3
0
	return dispatch => turbo({site_id:APP_ID}).currentUser()
		.then(data => {
			if (actionType != null){
				dispatch({
					type: actionType,
					data: data
				})
			}

			return data
		})
		.catch(err => {
			throw err
		})
Beispiel #4
0
	return dispatch => turbo({site_id:APP_ID}).fetch(resource, params)
		.then(data => {
			if (actionType != null){
				dispatch({
					type: actionType,
					params: params, // can be null
					data: data
				})
			}
			
			return data
		})
		.catch(err => {
			throw err
		})
Beispiel #5
0
const uploadFile = (file) => {
	return turbo({site_id:APP_ID}).uploadFile(file) // returns a Promise
}