async await in getGroup
This commit is contained in:
parent
5594fabb6a
commit
a57e8d939f
1 changed files with 2 additions and 2 deletions
|
|
@ -358,9 +358,9 @@ export async function getGroup(query: string) {
|
||||||
const dataMainGroup = await res.json();
|
const dataMainGroup = await res.json();
|
||||||
const fetchSubGroups = async (group: any) => {
|
const fetchSubGroups = async (group: any) => {
|
||||||
let fullSubGroup = await Promise.all(
|
let fullSubGroup = await Promise.all(
|
||||||
group.subGroups.map(async (subGroupsData: any) => {
|
group.subGroups.map((subGroupsData: any) => {
|
||||||
if (group.subGroupCount > 0) {
|
if (group.subGroupCount > 0) {
|
||||||
return await fetchSubGroups(subGroupsData);
|
return fetchSubGroups(subGroupsData);
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
id: subGroupsData.id,
|
id: subGroupsData.id,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue