renamed existing asset
This commit is contained in:
parent
249b6c6f0f
commit
0912cd45d9
7 changed files with 17 additions and 16 deletions
|
@ -20,7 +20,7 @@ export function getLongClaimId (name, modifier) {
|
||||||
}),
|
}),
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
}
|
}
|
||||||
// crate url
|
// create url
|
||||||
const url = `/api/claim/long-id`;
|
const url = `/api/claim/long-id`;
|
||||||
// return the request promise
|
// return the request promise
|
||||||
return Request(url, params);
|
return Request(url, params);
|
||||||
|
|
|
@ -10,9 +10,9 @@ const mapStateToProps = ({ show }) => {
|
||||||
// select asset info
|
// select asset info
|
||||||
const existingRequest = show.assetRequests[show.request.id];
|
const existingRequest = show.assetRequests[show.request.id];
|
||||||
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`;
|
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`;
|
||||||
const existingAsset = show.assetList[assetKey];
|
const asset = show.assetList[assetKey];
|
||||||
if (existingAsset) {
|
if (asset) {
|
||||||
props['asset'] = existingAsset;
|
props['asset'] = asset;
|
||||||
};
|
};
|
||||||
return props;
|
return props;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,9 +6,9 @@ const mapStateToProps = ({ show }) => {
|
||||||
// select title
|
// select title
|
||||||
const existingRequest = show.assetRequests[show.request.id];
|
const existingRequest = show.assetRequests[show.request.id];
|
||||||
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`;
|
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`;
|
||||||
const existingAsset = show.assetList[assetKey];
|
const asset = show.assetList[assetKey];
|
||||||
if (existingAsset) {
|
if (asset) {
|
||||||
props['title'] = existingAsset.claimData.title;
|
props['title'] = asset.claimData.title;
|
||||||
};
|
};
|
||||||
return props;
|
return props;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,10 +6,10 @@ const mapStateToProps = ({ show }) => {
|
||||||
// select name and claim id
|
// select name and claim id
|
||||||
const existingRequest = show.assetRequests[show.request.id];
|
const existingRequest = show.assetRequests[show.request.id];
|
||||||
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`;
|
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`;
|
||||||
const existingAsset = show.assetList[assetKey];
|
const asset = show.assetList[assetKey];
|
||||||
if (existingAsset) {
|
if (asset) {
|
||||||
props['name'] = existingAsset.name;
|
props['name'] = asset.name;
|
||||||
props['claimId'] = existingAsset.claimId;
|
props['claimId'] = asset.claimId;
|
||||||
};
|
};
|
||||||
return props;
|
return props;
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,10 +15,10 @@ const mapStateToProps = ({ show }) => {
|
||||||
props['existingRequest'] = existingRequest;
|
props['existingRequest'] = existingRequest;
|
||||||
// select asset info
|
// select asset info
|
||||||
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`; // note: just store this in the request
|
const assetKey = `a#${existingRequest.name}#${existingRequest.claimId}`; // note: just store this in the request
|
||||||
const existingAsset = show.assetList[assetKey];
|
const asset = show.assetList[assetKey];
|
||||||
if (existingAsset) {
|
if (asset) {
|
||||||
console.log('existing asset found', existingAsset);
|
console.log('existing asset found', asset);
|
||||||
props['asset'] = existingAsset;
|
props['asset'] = asset;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
return props;
|
return props;
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { getShortId, getClaimData } from 'api/assetApi';
|
||||||
function* getAssetDataAndShowAsset (action) {
|
function* getAssetDataAndShowAsset (action) {
|
||||||
const {id, name, claimId} = action.data;
|
const {id, name, claimId} = action.data;
|
||||||
// get short Id
|
// get short Id
|
||||||
|
console.log('getting short id');
|
||||||
let success, message, shortId;
|
let success, message, shortId;
|
||||||
try {
|
try {
|
||||||
({success, message, data: shortId} = yield call(getShortId, name, claimId));
|
({success, message, data: shortId} = yield call(getShortId, name, claimId));
|
||||||
|
@ -16,6 +17,7 @@ function* getAssetDataAndShowAsset (action) {
|
||||||
return yield put(updateRequestError(message));
|
return yield put(updateRequestError(message));
|
||||||
}
|
}
|
||||||
// if no error, get claim data
|
// if no error, get claim data
|
||||||
|
console.log('getting claim data');
|
||||||
success = null;
|
success = null;
|
||||||
let claimData;
|
let claimData;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { getChannelClaims } from 'api/channelApi';
|
||||||
|
|
||||||
function* getChannelClaimsAndShowChannel (action) {
|
function* getChannelClaimsAndShowChannel (action) {
|
||||||
const { id, name, shortId, longId } = action.data;
|
const { id, name, shortId, longId } = action.data;
|
||||||
console.log('getchannelclaimsandshowchannel', id, name, shortId, longId);
|
|
||||||
let success, message, claimsData;
|
let success, message, claimsData;
|
||||||
try {
|
try {
|
||||||
({ success, message, data: claimsData } = yield call(getChannelClaims, name, longId, 1));
|
({ success, message, data: claimsData } = yield call(getChannelClaims, name, longId, 1));
|
||||||
|
|
Loading…
Reference in a new issue