renamed existing asset

This commit is contained in:
bill bittner 2018-02-12 18:50:19 -08:00
parent 249b6c6f0f
commit 0912cd45d9
7 changed files with 17 additions and 16 deletions

View file

@ -20,7 +20,7 @@ export function getLongClaimId (name, modifier) {
}),
body: JSON.stringify(body),
}
// crate url
// create url
const url = `/api/claim/long-id`;
// return the request promise
return Request(url, params);

View file

@ -10,9 +10,9 @@ const mapStateToProps = ({ show }) => {
// select asset info
const existingRequest = show.assetRequests[show.request.id];
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`;
const existingAsset = show.assetList[assetKey];
if (existingAsset) {
props['asset'] = existingAsset;
const asset = show.assetList[assetKey];
if (asset) {
props['asset'] = asset;
};
return props;
};

View file

@ -6,9 +6,9 @@ const mapStateToProps = ({ show }) => {
// select title
const existingRequest = show.assetRequests[show.request.id];
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`;
const existingAsset = show.assetList[assetKey];
if (existingAsset) {
props['title'] = existingAsset.claimData.title;
const asset = show.assetList[assetKey];
if (asset) {
props['title'] = asset.claimData.title;
};
return props;
};

View file

@ -6,10 +6,10 @@ const mapStateToProps = ({ show }) => {
// select name and claim id
const existingRequest = show.assetRequests[show.request.id];
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`;
const existingAsset = show.assetList[assetKey];
if (existingAsset) {
props['name'] = existingAsset.name;
props['claimId'] = existingAsset.claimId;
const asset = show.assetList[assetKey];
if (asset) {
props['name'] = asset.name;
props['claimId'] = asset.claimId;
};
return props;
};

View file

@ -15,10 +15,10 @@ const mapStateToProps = ({ show }) => {
props['existingRequest'] = existingRequest;
// select asset info
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`; // note: just store this in the request
const existingAsset = show.assetList[assetKey];
if (existingAsset) {
console.log('existing asset found', existingAsset);
props['asset'] = existingAsset;
const asset = show.assetList[assetKey];
if (asset) {
console.log('existing asset found', asset);
props['asset'] = asset;
};
};
return props;

View file

@ -6,6 +6,7 @@ import { getShortId, getClaimData } from 'api/assetApi';
function* getAssetDataAndShowAsset (action) {
const {id, name, claimId} = action.data;
// get short Id
console.log('getting short id');
let success, message, shortId;
try {
({success, message, data: shortId} = yield call(getShortId, name, claimId));
@ -16,6 +17,7 @@ function* getAssetDataAndShowAsset (action) {
return yield put(updateRequestError(message));
}
// if no error, get claim data
console.log('getting claim data');
success = null;
let claimData;
try {

View file

@ -5,7 +5,6 @@ import { getChannelClaims } from 'api/channelApi';
function* getChannelClaimsAndShowChannel (action) {
const { id, name, shortId, longId } = action.data;
console.log('getchannelclaimsandshowchannel', id, name, shortId, longId);
let success, message, claimsData;
try {
({ success, message, data: claimsData } = yield call(getChannelClaims, name, longId, 1));