Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

282
Views
Rest Api/Vue : How to map as a new Object from an Object that contains multiple objects

I feel like my title is lil confusing (I am as well..) But, Can anyone help me with creating a new array from Objects list? I am getting : API result

from the server when I request getSearchList. I want to put those two lists into one list as AllTag that contains

  1. all tags from tagList[] :

current : tagList:{{tag_no:1, tag_content:"#mood"},{tag_no:2, tag_content: "#food"}}

  1. only nick_names and user_no but add @ in front of user_nickname :

current : {{user_no:1, user_nickname:'nickname1',user_email:'n@gmail.com',...}... } change to : {{user_no:1, user_nickname : '@nickname1'}, {user_no:2, user_nickname:'@nickname2'}...}

  1. Map Together in AllTags{} :

I want => AllTags{{ tag_no:1, tag_content:"#mood"},{tag_no:2,tag_content:"#food"}...{user_no:1, user_nickname:"@nick1name"}, {user_no:2, user_nickname:"@nickname2"}}

Is this possible ??

Below is my axios and javascript code:

search.vue

import { getSearchList } from "@/api/searchAPI.js";
...
created() {
            /*const objData = {
                    tagList:[],
                    userList: [],
                },
                keys = { tagList: "tag_name", userList:"user_nickname" },
                result = Object.entries(objData).reduce(
                    (r, [key, array]) =>
                        array.map((v, i) => ({ ...r[i], [keys[key]]: v })),
                    []
                );*/

            console.log(result);
            getSearchList(
                (response) => {
                    this.AllTags = response.data;
                    console.log(this.AllTags);
                    console.log(this.AllTags.userList);
                },
                (error) => {
                    console.log(error);
                }
            );

searchAPI.js

import { apiInstance } from './index.js';

const api = apiInstance();

function getSearchList( param, success, fail) {
    api.get(`/challympic/search`, {params:param}).then(success).catch(fail);
}
  
export { getSearchList};
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!