ma39isy

Untitled

Feb 27th, 2024
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async getActivities(token: string) {
  2.         const {data: response} = await lastValueFrom(this.httpService.get(`api/plugins/telemetry/USER/9e8592a0-811e-11ee-b916-ed4de8cf8322/values/timeseries`, {headers: {Authorization: `Bearer ${token}`}}));
  3.         return response.entityType.map((_, index) => {
  4.             const data = {}
  5.             Object.keys(response).forEach(key => {
  6.                 if (key === 'activityPic') {
  7.                     // const jpg = 'data:image/jpeg;base64,'
  8.                     data[key] = response[key][index].value
  9.                 } else data[key] = response[key][index].value
  10.             })
  11.             return data
  12.         })
  13.     }
Add Comment
Please, Sign In to add comment