Replaced default height and weight fields with fields taking units argument.

This commit is contained in:
2019-12-16 02:39:13 +01:00
parent 577c03f9b7
commit f4c2e6c08c
8 changed files with 133 additions and 26 deletions

View File

@@ -4,8 +4,23 @@ function curateActor(actor) {
const curatedActor = {
...actor,
avatar: actor.avatar[0],
origin: {
country: actor.originCountry,
height: actor.heightMetric && {
metric: actor.heightMetric,
imperial: actor.heightImperial,
},
weight: actor.weightMetric && {
metric: actor.weightMetric,
imperial: actor.weightImperial,
},
origin: actor.birthCountry && {
city: actor.birthCity,
state: actor.birthState,
country: actor.birthCountry,
},
residence: actor.residenceCountry && {
city: actor.residenceCity,
state: actor.residenceState,
country: actor.residenceCountry,
},
};
@@ -20,14 +35,50 @@ function initActorActions(store, _router) {
id
name
slug
gender
birthdate
age
ethnicity
bust
waist
hip
heightMetric: height(units:METRIC)
heightImperial: height(units:IMPERIAL)
weightMetric: weight(units:METRIC)
weightImperial: weight(units:IMPERIAL)
hasTattoos
hasPiercings
tattoos
piercings
avatar: actorsMediasByTargetId(condition: { role:"avatar" }) {
thumbnail
path
}
originCountry: countryByBirthCountryAlpha2 {
photos: actorsMediasByTargetId(condition: { role:"photo" }) {
id
thumbnail
path
index
}
birthCity
birthState
birthCountry: countryByBirthCountryAlpha2 {
alpha2
name
alias
}
residenceCity
residenceState
residenceCountry: countryByResidenceCountryAlpha2 {
alpha2
name
alias
}
social: actorsSocialsByTargetId {
id
url
platform
}
aliases: actorsByAliasFor {
id
name
@@ -56,7 +107,7 @@ function initActorActions(store, _router) {
avatar: actorsMediasByTargetId(condition: { role:"avatar" }) {
thumbnail
}
originCountry: countryByBirthCountryAlpha2 {
birthCountry: countryByBirthCountryAlpha2 {
alpha2
name
alias
@@ -67,8 +118,6 @@ function initActorActions(store, _router) {
limit,
});
console.log(actors);
return actors.map(actor => curateActor(actor));
}