[New Feature] Apply graph strategy

This commit is contained in:
Qolzam
2018-01-12 13:40:59 +07:00
parent 7231c59f92
commit e38dbc9fd3
169 changed files with 2931 additions and 2580 deletions

View File

@@ -0,0 +1,51 @@
import moment from 'moment'
// - Import action types
import { ServerActionType } from 'constants/serverActionType'
// - Import domain
// - Import actions
import * as globalActions from 'actions/globalActions'
import { ServerRequestModel } from 'models/server/serverRequestModel'
import { SocialError } from 'core/domain/common/socialError'
/**
* Add a request
* @param {Request} request
*/
export const sendRequest = (request: ServerRequestModel) => {
return { type: ServerActionType.ADD_REQUEST, payload: request }
}
/**
* delete a request
*/
export const deleteRequest = (requestId: string) => {
return { type: ServerActionType.DELETE_REQUEST, payload: {requestId} }
}
/**
* Update request stattus ti successful
*/
export const okRequest = (requestId: string) => {
return { type: ServerActionType.OK_REQUEST, payload: {requestId} }
}
/**
* Set error request
*/
export const errorRequest = (requestId: string, error: SocialError) => {
return { type: ServerActionType.ERROR_REQUEST, payload: {requestId, error} }
}
/**
* Clear all data
*/
export const clearAllrequests = () => {
return { type: ServerActionType.CLEAR_ALL_DATA_REQUEST }
}