updated backend to read 3box collectiblesFavorite (#221)

* updated backend to read 3box collectiblesFavorite

* removed unneccesary '?'
This commit is contained in:
dan13ram
2020-12-16 07:12:58 +05:30
committed by GitHub
parent 731a56ed73
commit 566be91206
3 changed files with 26 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
import Box, { Image } from '3box';
import Box, { CollectiblesFavorite, Image } from '3box';
import { CONFIG } from '../../../../config';
import {
@@ -34,6 +34,9 @@ export const getBoxProfile: QueryResolvers['getBoxProfile'] = async (
height: 300,
}),
website: boxProfile.website,
collectiblesFavorites: getCollectiblesFavourites(
boxProfile.collectiblesFavorites,
),
};
};
@@ -47,3 +50,13 @@ function getImage(
}
return '';
}
function getCollectiblesFavourites(
collectiblesFavorites: Array<CollectiblesFavorite> | null | undefined,
) {
if (!collectiblesFavorites) return [];
return collectiblesFavorites.map(({ address, token_id }) => ({
address,
tokenId: token_id,
}));
}

View File

@@ -16,6 +16,12 @@ export const typeDefs = gql`
imageUrl: String
coverImageUrl: String
website: String
collectiblesFavorites: [CollectiblesFavorites!]
}
type CollectiblesFavorites {
address: String
tokenId: String
}
type Moloch {

View File

@@ -358,6 +358,7 @@ enum AccountType_update_column {
}
type BoxProfile {
collectiblesFavorites: [CollectiblesFavorites!]
coverImageUrl: String
description: String
emoji: String
@@ -369,6 +370,11 @@ type BoxProfile {
website: String
}
type CollectiblesFavorites {
address: String
tokenId: String
}
"""
columns and relationships of "EnneagramType"
"""