Skip to content

Commit

Permalink
♻️ r Adapt to new data structure
Browse files Browse the repository at this point in the history
Co-authored-by: javikalsan <[email protected]>
  • Loading branch information
2 people authored and vokimon committed Nov 6, 2024
1 parent 96e2331 commit 844607b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/containers/Contract/Review.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const Review = (props) => {
city_id: values.supply_point.city.id
})
.then((response) => {
const tariffPrices = response?.data
const tariffPrices = response?.data['current']
setPrices(tariffPrices)
setLoading(false)
})
Expand Down Expand Up @@ -181,7 +181,7 @@ const Review = (props) => {
}
}}>
<span key={`${name}`}>
{`${concept[key]?.value} ${concept[key]?.uom}`}
{`${concept[key]?.value} ${concept[key]?.unit}`}
</span>
</Box>
)
Expand All @@ -207,7 +207,7 @@ const Review = (props) => {
{concept ? (
keys.map((key, index) => (
<span key={`${name}:${key}`}>
{`${labels[index]}: ${concept[key]?.value} ${concept[key]?.uom}`}
{`${labels[index]}: ${concept[key]?.value} ${concept[key]?.unit}`}
</span>
))
) : (
Expand Down Expand Up @@ -495,36 +495,36 @@ const Review = (props) => {
<Grid item xs={12} sm={6}>
<ReviewField
label={t('TERME_ENERGIA')}
value={<Prices concept={prices?.te} name="te" />}
value={<Prices concept={prices?.energia} name="te" />}
multipleValues={true}
/>
</Grid>
<Grid item xs={12} sm={6}>
<ReviewField
label={t('GENERATION')}
value={<Prices concept={prices?.gkwh} name="gkwh" />}
value={<Prices concept={prices?.generation_kWh} name="gkwh" />}
multipleValues={true}
/>
</Grid>
<Grid item xs={12} sm={6}>
<ReviewField
label={t('TERME_POTENCIA')}
value={<Prices concept={prices?.tp} name="tp" />}
value={<Prices concept={prices?.potencia} name="tp" />}
multipleValues={true}
/>
</Grid>
<Grid item xs={12} sm={6}>
<ReviewField
label={t('AUTOCONSUM')}
value={<Prices concept={prices?.ac} name="ac" />}
value={<Prices concept={prices?.energia_autoconsumida} name="ac" />}
multipleValues={true}
/>
</Grid>
{prices?.bo_social?.value ? (
<Grid item xs={12} sm={6}>
<ReviewField
label={t('BO_SOCIAL')}
value={`${prices?.bo_social?.value} ${prices?.bo_social?.uom}`}
value={`${prices?.bo_social?.value} ${prices?.bo_social?.unit}`}
multipleValues={true}
/>
</Grid>
Expand Down

0 comments on commit 844607b

Please sign in to comment.