forked from Qortal/qortal-ui
Merge pull request #130 from PhillipLangMartinez/bugfix/fix-gif-error-my-collections
fix issues with fetching my collection
This commit is contained in:
commit
d7a3a74364
@ -176,7 +176,7 @@ setOpenGifModal: { attribute: false }
|
|||||||
let collectionObj = collection;
|
let collectionObj = collection;
|
||||||
try {
|
try {
|
||||||
const metaData = await parentEpml.request('apiCall', {
|
const metaData = await parentEpml.request('apiCall', {
|
||||||
url: `/arbitrary/metadata/GIF_REPOSITORY/${this.myAccountName}/${collection.identifier}?apiKey=${this.getApiKey()}`,
|
url: `/arbitrary/metadata/GIF_REPOSITORY/${collection.name}/${collection.identifier}?apiKey=${this.getApiKey()}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
collectionObj = {
|
collectionObj = {
|
||||||
@ -186,10 +186,10 @@ setOpenGifModal: { attribute: false }
|
|||||||
if (metaData.files) {
|
if (metaData.files) {
|
||||||
const metaDataArray = metaData.files.map((data) => {
|
const metaDataArray = metaData.files.map((data) => {
|
||||||
return {
|
return {
|
||||||
url: `${nodeUrl}/arbitrary/GIF_REPOSITORY/${this.myAccountName}/${collection.identifier}?filepath=${data}&apiKey=${this.getApiKey()}`,
|
url: `${nodeUrl}/arbitrary/GIF_REPOSITORY/${collection.name}/${collection.identifier}?filepath=${data}&apiKey=${this.getApiKey()}`,
|
||||||
filePath: data,
|
filePath: data,
|
||||||
identifier: collection.identifier,
|
identifier: collection.identifier,
|
||||||
name: this.myAccountName
|
name: collection.name
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -289,7 +289,7 @@ setOpenGifModal: { attribute: false }
|
|||||||
this.myAccountName = userName;
|
this.myAccountName = userName;
|
||||||
if (this.myAccountName) {
|
if (this.myAccountName) {
|
||||||
const getMyGifCollections = await parentEpml.request('apiCall', {
|
const getMyGifCollections = await parentEpml.request('apiCall', {
|
||||||
url: `/arbitrary/resources?service=GIF_REPOSITORY&limit=0&name=${this.myAccountName}&apiKey=${this.getApiKey()}`,
|
url: `/arbitrary/resources/search?service=GIF_REPOSITORY&query=${this.myAccountName}&apiKey=${this.getApiKey()}`,
|
||||||
});
|
});
|
||||||
const gifCollectionWithMetaData = await this.structureCollections(
|
const gifCollectionWithMetaData = await this.structureCollections(
|
||||||
getMyGifCollections
|
getMyGifCollections
|
||||||
@ -327,10 +327,14 @@ setOpenGifModal: { attribute: false }
|
|||||||
const identifier = splitCollection[1];
|
const identifier = splitCollection[1];
|
||||||
try {
|
try {
|
||||||
const data = await parentEpml.request('apiCall', {
|
const data = await parentEpml.request('apiCall', {
|
||||||
url: `/arbitrary/resources?service=GIF_REPOSITORY&limit=0&name=${name}&identifier=${identifier}&apiKey=${this.getApiKey()}`,
|
url: `/arbitrary/metadata/GIF_REPOSITORY/${name}/${identifier}?apiKey=${this.getApiKey()}`,
|
||||||
|
});
|
||||||
|
if (data.title) {
|
||||||
|
savedCollections.push({
|
||||||
|
identifier,
|
||||||
|
name,
|
||||||
|
service: 'GIF_REPOSITORY'
|
||||||
});
|
});
|
||||||
if (data.length > 0) {
|
|
||||||
savedCollections.push(data[0]);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@ -403,7 +407,7 @@ setOpenGifModal: { attribute: false }
|
|||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
const userName = await this.getName(this.selectedAddress.address);
|
const userName = await this.getName(this.selectedAddress.address);
|
||||||
const doesNameExist = await parentEpml.request('apiCall', {
|
const doesNameExist = await parentEpml.request('apiCall', {
|
||||||
url: `/arbitrary/resources?service=GIF_REPOSITORY&limit=0&name=${userName}&identifier=${this.newCollectionName}&apiKey=${this.getApiKey()}`,
|
url: `/arbitrary/metadata/GIF_REPOSITORY/${userName}/${this.newCollectionName}?apiKey=${this.getApiKey()}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!userName) {
|
if (!userName) {
|
||||||
@ -492,7 +496,7 @@ setOpenGifModal: { attribute: false }
|
|||||||
let myCollection = await parentEpml.request(
|
let myCollection = await parentEpml.request(
|
||||||
'apiCall',
|
'apiCall',
|
||||||
{
|
{
|
||||||
url: `/arbitrary/resources?service=GIF_REPOSITORY&limit=0&name=${userName}&identifier=${this.newCollectionName}&apiKey=${this.getApiKey()}`,
|
url: `/arbitrary/metadata/GIF_REPOSITORY/${userName}/${this.newCollectionName}&apiKey=${this.getApiKey()}`,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (myCollection.length > 0) {
|
if (myCollection.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user