File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
src/core/foundation-core-services/composables/services Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export const useAggregateValue = () => {
1212 const fetching = ref ( false ) ;
1313 const error = ref < string | null > ( null ) ;
1414 const value = ref < number | null > ( null ) ;
15+ const unit = ref < string | null > ( null ) ;
1516
1617 const fetch = async ( filter : AggregateValueFilter ) => {
1718 fetching . value = true ;
@@ -62,8 +63,10 @@ export const useAggregateValue = () => {
6263 const dataSerie = await getManyDatas ( periodFilters ) ;
6364
6465 const dataSerieValue = dataSerie ?. [ 0 ] ?. datas ?. [ 0 ] ?. values ?. [ 0 ] ;
66+ const dataSerieUnit = dataSerie ?. [ 0 ] ?. meta . valueUnits ?. [ 0 ] ; ;
6567
6668 value . value = dataSerieValue == null ? null : Number ( dataSerieValue ) ;
69+ unit . value = dataSerieUnit == null ? null : dataSerieUnit ;
6770
6871 } catch ( exception : any ) {
6972 error . value = exception . response ?. data ?? exception . message ;
@@ -76,6 +79,7 @@ export const useAggregateValue = () => {
7679 fetching,
7780 error,
7881 value,
82+ unit,
7983 fetch,
8084 } ;
8185} ;
You can’t perform that action at this time.
0 commit comments