add ethereumAddress to getBoxProfile

This commit is contained in:
Pacien Boisson
2020-07-28 10:43:14 +02:00
committed by Hammad Jutt
parent f79e8cd261
commit af728ac53d
3 changed files with 12 additions and 11 deletions

View File

@@ -18,6 +18,7 @@ type UpdateBoxProfileResponse {
}
type BoxProfile {
ethereumAddress : String
name : String
description : String
location : String

View File

@@ -8,11 +8,12 @@ const handler = async (req: Request, res: Response) => {
const { address } = req.body.input;
const boxProfile = await Box.getProfile(address);
if(Object.keys(boxProfile).length === 0) {
if (Object.keys(boxProfile).length === 0) {
return res.json({});
}
const parsedProfile: BoxProfile = {
ethereumAddress: address,
name: boxProfile.name,
description: boxProfile.description,
location: boxProfile.location,

View File

@@ -1,15 +1,14 @@
type Maybe<T> = T | null
type Maybe<T> = T | null;
type BoxProfile = {
name: string|null,
description: string|null,
location: string|null,
job: string|null,
emoji: string|null,
imageUrl: string|null,
}
ethereumAddress: string | null;
name: string | null;
description: string | null;
location: string | null;
job: string | null;
emoji: string | null;
imageUrl: string | null;
};
type UpdateBoxProfileResponse = {
success: boolean;