How to get the corresponding data in the shopping cart

my general idea is like this, but it always feels wrong. Help me take a look.

first add a set of data to the list array while clicking add to the shopping cart, as follows:

list:[{id:123,count:1},{id:456,count:2}]

then loop through the list array in the shopping cart to get id and count.
and send an axios request, compare the id with the background data, get the data (object) and use vue.set to add the field "count" to the data and assign a value.
ends up with a piece of data corresponding to list.

but doing so will cause the number of axios requests sent to be equal to the length of the list array.

is mainly about how to solve the problem of number of requests and count field.

Apr.15,2022

allows the backend to provide an interface. The parameter required by the interface is a collection of id, and then returns an array set like list

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a0c3-2ba35.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a0c3-2ba35.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?