Загрузка данных списка задач из api kanban-доски
This commit is contained in:
parent
7be8f43797
commit
e79a7cd492
1 changed files with 7 additions and 3 deletions
|
|
@ -43,7 +43,7 @@ export const PageStore = types.model({
|
||||||
});
|
});
|
||||||
|
|
||||||
export async function PageStoreLoadData(store: IPageStore): Promise<void> {
|
export async function PageStoreLoadData(store: IPageStore): Promise<void> {
|
||||||
const url = `/simple-issues-list/${store.type}/${store.name}/raw`;
|
const url = `/simple-kanban-board/${store.type}/${store.name}/raw`;
|
||||||
const resp = await axios.get(url);
|
const resp = await axios.get(url);
|
||||||
if (!(resp?.data)) return;
|
if (!(resp?.data)) return;
|
||||||
|
|
||||||
|
|
@ -52,12 +52,16 @@ export async function PageStoreLoadData(store: IPageStore): Promise<void> {
|
||||||
const item = resp.data[i] as {data: any[], metainfo: Record<string, any>};
|
const item = resp.data[i] as {data: any[], metainfo: Record<string, any>};
|
||||||
data.push({
|
data.push({
|
||||||
metainfo: item.metainfo,
|
metainfo: item.metainfo,
|
||||||
data: item.data.map((group: {status: string, count: number, issues: any[]}) => {
|
data: item.data ? item.data.map((group: { status: string, count: number, issues: any[] }) => {
|
||||||
return group.issues
|
return group.issues
|
||||||
}).flat()
|
}).flat() : []
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DEBUG: begin */
|
||||||
|
console.debug(`Issues list board store data: ${JSON.stringify(data)}`);
|
||||||
|
/* DEBUG: end */
|
||||||
|
|
||||||
store.setData(data);
|
store.setData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue