Skip to content

Commit

Permalink
fix: e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Mar 5, 2024
1 parent 3c99921 commit a4605f7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/core-sdk/src/metadata/bundle.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fragment BaseBundleMetadataEntityFields on BundleMetadataEntity {
terms {
key
value
displayType
displayKey
}
quantity
attributes {
Expand Down
2 changes: 1 addition & 1 deletion packages/core-sdk/src/offers/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ fragment BaseOfferFields on Offer {
terms {
key
value
displayType
displayKey
}
quantity
attributes {
Expand Down
2 changes: 1 addition & 1 deletion packages/metadata/src/nftItem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ export type NftItem = Omit<IItemMetadata, "type"> & {
terms?: {
key: string;
value: string;
displayType?: string;
displayKey?: string;
}[];
};
2 changes: 1 addition & 1 deletion packages/metadata/src/nftItem/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"properties": {
"key": { "type": "string"},
"value": { "type": "string"},
"displayType": { "type": "string"}
"displayKey": { "type": "string"}
},
"required": ["value", "key"]
}
Expand Down
2 changes: 2 additions & 0 deletions packages/metadata/tests/nft-item/valid/full.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
"quantity": 18,
"terms": [
{
"displayKey": "",
"key": "transferMethod",
"value": "safeTransferFrom(address,address,uint256)"
},
{
"displayKey": "",
"key": "transferDelay",
"value": "15 days"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ type Term @entity {
id: ID!
key: String!
value: String!
displayType: String!
displayKey: String!
}


Expand Down
10 changes: 5 additions & 5 deletions packages/subgraph/src/entities/metadata/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export function saveMetadataAttributes(
export function getTermId(
key: string,
value: string,
displayType: string
displayKey: string
): string {
return `${key}-${value}-${displayType}`;
return `${key}-${value}-${displayKey}`;
}

export function saveTerms(
Expand All @@ -70,8 +70,8 @@ export function saveTerms(
const termsObj = termsArray[i];
const key = convertToString(termsObj.get("key"));
const value = convertToString(termsObj.get("value"));
const displayType = convertToString(termsObj.get("displayType"));
const termId = getTermId(key, value, displayType);
const displayKey = convertToString(termsObj.get("displayKey"));
const termId = getTermId(key, value, displayKey);

let term = Term.load(termId);

Expand All @@ -81,7 +81,7 @@ export function saveTerms(

term.key = key;
term.value = value;
term.displayType = displayType;
term.displayKey = displayKey;
term.save();
savedTermsIds.push(termId);
}
Expand Down

0 comments on commit a4605f7

Please sign in to comment.