| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using DCL.Builder; |
| | 4 | | using DCL.Helpers; |
| | 5 | | using UnityEngine; |
| | 6 | |
|
| | 7 | | public static class BuilderPanelDataFetcher |
| | 8 | | { |
| | 9 | | public static Promise<ProjectData[]> FetchProjectData(IBuilderAPIController apiController) |
| | 10 | | { |
| 1 | 11 | | var promise = new Promise<ProjectData[]>(); |
| 1 | 12 | | var manifestPromise = apiController.GetAllManifests(); |
| 1 | 13 | | manifestPromise.Then(projectList => |
| | 14 | | { |
| 0 | 15 | | promise.Resolve(projectList.ToArray()); |
| 0 | 16 | | }); |
| 1 | 17 | | manifestPromise.Catch(error => |
| | 18 | | { |
| 0 | 19 | | promise.Reject(error); |
| 0 | 20 | | }); |
| | 21 | |
|
| 1 | 22 | | return promise; |
| | 23 | | } |
| | 24 | | } |