2018-02-01 23:29:33 +01:00
|
|
|
import * as actions from 'constants/show_action_types';
|
|
|
|
|
2018-02-07 20:30:39 +01:00
|
|
|
export function updateRequestError (error) {
|
|
|
|
return {
|
|
|
|
type: actions.REQUEST_ERROR_UPDATE,
|
|
|
|
data: error,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-02-02 20:10:58 +01:00
|
|
|
export function updateRequestWithChannelRequest (name, id) {
|
2018-02-01 23:29:33 +01:00
|
|
|
return {
|
2018-02-07 19:52:09 +01:00
|
|
|
type: actions.REQUEST_CHANNEL_UPDATE,
|
2018-02-06 20:55:46 +01:00
|
|
|
data: {
|
|
|
|
name,
|
|
|
|
id,
|
|
|
|
},
|
2018-02-01 23:29:33 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-02 20:10:58 +01:00
|
|
|
export function updateRequestWithAssetRequest (name, id, channelName, channelId, extension) {
|
2018-02-01 23:29:33 +01:00
|
|
|
return {
|
2018-02-07 19:52:09 +01:00
|
|
|
type: actions.REQUEST_CLAIM_UPDATE,
|
2018-02-06 20:55:46 +01:00
|
|
|
data: {
|
|
|
|
name,
|
|
|
|
modifier: {
|
|
|
|
id,
|
|
|
|
channel: {
|
|
|
|
name: channelName,
|
|
|
|
id : channelId,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
extension,
|
|
|
|
},
|
2018-02-01 23:29:33 +01:00
|
|
|
};
|
|
|
|
};
|
2018-02-03 03:16:18 +01:00
|
|
|
|
2018-02-07 20:30:39 +01:00
|
|
|
export function updateShowChannelError (error) {
|
2018-02-07 19:52:09 +01:00
|
|
|
return {
|
2018-02-07 20:30:39 +01:00
|
|
|
type: actions.SHOW_CHANNEL_ERROR,
|
2018-02-07 19:52:09 +01:00
|
|
|
data: error,
|
|
|
|
};
|
2018-02-07 20:30:39 +01:00
|
|
|
};
|
2018-02-07 19:52:09 +01:00
|
|
|
|
2018-02-03 03:16:18 +01:00
|
|
|
export function updateChannelData (name, longId, shortId) {
|
|
|
|
return {
|
|
|
|
type: actions.CHANNEL_DATA_UPDATE,
|
2018-02-06 20:55:46 +01:00
|
|
|
data: {
|
|
|
|
name,
|
|
|
|
longId,
|
|
|
|
shortId,
|
|
|
|
},
|
2018-02-03 03:16:18 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export function updateChannelClaimsData (claims, currentPage, totalPages, totalClaims) {
|
|
|
|
return {
|
|
|
|
type: actions.CHANNEL_CLAIMS_DATA_UPDATE,
|
2018-02-06 20:55:46 +01:00
|
|
|
data: {
|
|
|
|
claims,
|
|
|
|
currentPage,
|
|
|
|
totalPages,
|
|
|
|
totalClaims,
|
|
|
|
},
|
2018-02-03 03:16:18 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-07 04:00:52 +01:00
|
|
|
export function fileRequested (name, claimId) {
|
|
|
|
return {
|
|
|
|
type: actions.FILE_REQUESTED,
|
|
|
|
data: {
|
|
|
|
name,
|
|
|
|
claimId,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-07 19:52:09 +01:00
|
|
|
export function updateFileAvailability (status) {
|
2018-02-07 04:00:52 +01:00
|
|
|
return {
|
2018-02-07 19:52:09 +01:00
|
|
|
type: actions.FILE_AVAILABILITY_UPDATE,
|
2018-02-07 04:00:52 +01:00
|
|
|
data: status,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-07 19:52:09 +01:00
|
|
|
export function updateDisplayAssetError (error) {
|
|
|
|
return {
|
|
|
|
type: actions.DISPLAY_ASSET_ERROR,
|
|
|
|
data: error,
|
|
|
|
};
|
|
|
|
};
|
2018-02-07 22:26:07 +01:00
|
|
|
|
2018-02-08 03:01:51 +01:00
|
|
|
// new: request-related actions
|
2018-02-07 22:26:07 +01:00
|
|
|
|
|
|
|
export function newAssetRequest (id, name, modifier) {
|
|
|
|
return {
|
|
|
|
type: actions.NEW_ASSET_REQUEST,
|
|
|
|
data: { id, name, modifier },
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-08 03:01:51 +01:00
|
|
|
export function addAssetRequest (id, error, name, claimId) {
|
2018-02-07 22:26:07 +01:00
|
|
|
return {
|
|
|
|
type: actions.ASSET_REQUEST_ADD,
|
2018-02-08 03:01:51 +01:00
|
|
|
data: { id, error, name, claimId },
|
2018-02-07 22:26:07 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-02-08 03:01:51 +01:00
|
|
|
// new: asset-realted actions
|
|
|
|
|
|
|
|
export function showNewAsset (id, name, claimId) {
|
|
|
|
console.log('show new asset', id, name, claimId);
|
|
|
|
return {
|
|
|
|
type: actions.SHOW_NEW_ASSET,
|
|
|
|
data: { id, name, claimId },
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export function updateShowAsset (id, error, name, claimId, shortId, claimData) {
|
|
|
|
return {
|
|
|
|
type: actions.SHOW_ASSET_UPDATE,
|
|
|
|
data: { id, error, name, claimId, shortId, claimData },
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export function clearShowAsset () {
|
|
|
|
return {
|
|
|
|
type: actions.SHOW_ASSET_CLEAR,
|
|
|
|
};
|
|
|
|
};
|