This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
Sphere/app/actions/index.js

28 lines
683 B
JavaScript
Raw Normal View History

2016-04-28 17:34:20 +01:00
import methods from './methods';
import makeAsyncActionSet from './makeAsyncActionSet';
import buildAsyncAction from './buildAsyncAction';
import endpoints from '../settings/endpoints';
export const LOGIN = makeAsyncActionSet('LOGIN');
2016-05-02 21:07:07 +01:00
export function login(token, callback) {
2016-04-28 17:34:20 +01:00
return buildAsyncAction(
LOGIN,
endpoints.get('USER_INFO').query({ 'circle-token': token }).toString(),
methods.GET,
{},
2016-05-02 21:07:07 +01:00
{ token, callback }
2016-04-28 17:34:20 +01:00
);
}
2016-05-05 13:34:10 +01:00
export const GET_PROJECTS = makeAsyncActionSet('GET_PROJECTS');
export function getProjects(callback) {
return buildAsyncAction(
GET_PROJECTS,
endpoints.get('ALL_PROJECTS'),
methods.GET,
{},
{ callback }
);
}