Is it right to write that you want getScanFilesPromise to complete the loop before performing. Then?

  arr.forEach(function (scans) {
            getScanFilesPromise(project, subject, experiment, scans)
                .then((files) => {
                    const getFilesTags = files.map((file) => {
                        return getFilesTagsPromise(project, subject, experiment, scans, file)
                    });

                    Promise.all(getFilesTags).then((tagsList) => {
                        res.json(tagsList.map((tags) => {
                            const obj = {};
                            tags.forEach((tag) => {
                                obj[tag.tag] = {
                                    "Value": [tag.value],
                                    "vr": tag.vr,
                                }
                            });
                            return obj;
                        }));
                    });
                })
        })

is it right to write that you want getScanFilesPromise to execute. Then finish the loop? How should it be modified?

Feb.10,2022
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-1b4003e-2c4c5.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-1b4003e-2c4c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?