Skip to content

Commit

Permalink
fix: check data format (#741)
Browse files Browse the repository at this point in the history
* fix: check data format

* fix: add moderated_comments post relationship
  • Loading branch information
gabehamilton authored Apr 9, 2024
1 parent 6af3bcb commit 5673c5b
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 53 deletions.
4 changes: 4 additions & 0 deletions indexers/components/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,10 @@ async function getBlock(block: Block) {
return;
}
const accountId = Object.keys(functionCall.args.data)[0];
if (!functionCall.args.data[accountId]) {
console.log("Set operation did not have arg data for accountId");
return;
}
const data_keys = Object.keys(functionCall.args.data[accountId]);
if (!data_keys) {
console.log(
Expand Down
127 changes: 74 additions & 53 deletions indexers/feed/relationships.json
Original file line number Diff line number Diff line change
@@ -1,66 +1,87 @@
{
"object_relationships": [
{
"name": "account",
"using": {
"manual_configuration": {
"column_mapping": {
"account_id": "account_id"
},
"insertion_order": null,
"remote_table": {
"name": "accounts",
"schema": "dataplatform_near_accounts"
"moderated_posts": {
"object_relationships": [
{
"name": "account",
"using": {
"manual_configuration": {
"column_mapping": {
"account_id": "account_id"
},
"insertion_order": null,
"remote_table": {
"name": "accounts",
"schema": "dataplatform_near_accounts"
}
}
}
}
},
{
"name": "verifications",
"using": {
"manual_configuration": {
"column_mapping": {
"account_id": "account_id"
},
"insertion_order": null,
"remote_table": {
"name": "account",
"schema": "dataplatform_near_verifications"
},
{
"name": "verifications",
"using": {
"manual_configuration": {
"column_mapping": {
"account_id": "account_id"
},
"insertion_order": null,
"remote_table": {
"name": "account",
"schema": "dataplatform_near_verifications"
}
}
}
}
}
],
"array_relationships": [
{
"name": "comments",
"using": {
"manual_configuration": {
"column_mapping": {
"id": "post_id"
},
"insertion_order": null,
"remote_table": {
"name": "moderated_comments",
"schema": "dataplatform_near_feed"
],
"array_relationships": [
{
"name": "comments",
"using": {
"manual_configuration": {
"column_mapping": {
"id": "post_id"
},
"insertion_order": null,
"remote_table": {
"name": "moderated_comments",
"schema": "dataplatform_near_feed"
}
}
}
},
{
"name": "post_likes",
"using": {
"manual_configuration": {
"column_mapping": {
"id": "post_id"
},
"insertion_order": null,
"remote_table": {
"name": "post_likes",
"schema": "dataplatform_near_social_feed"
}
}
}
}
},
{
"name": "post_likes",
"using": {
"manual_configuration": {
"column_mapping": {
"id": "post_id"
},
"insertion_order": null,
"remote_table": {
"name": "post_likes",
"schema": "dataplatform_near_social_feed"
]
},
"moderated_comments": {
"object_relationships": [
{
"name": "post",
"using": {
"manual_configuration": {
"column_mapping": {
"post_id": "id"
},
"insertion_order": null,
"remote_table": {
"name": "moderated_posts",
"schema": "dataplatform_near_feed"
}
}
}
}
}
]
]
}
}

0 comments on commit 5673c5b

Please sign in to comment.