|
7 | 7 | } from "../model/component"; |
8 | 8 | import { CallbackCallRequest, ChangeRequest, Change } from "../model/callback"; |
9 | 9 | import fetchApiResult from "../utils/fetchApiResult"; |
10 | | -import { fetchCallbackCallResults } from "../api"; |
| 10 | +import { fetchChangeRequests } from "../api"; |
11 | 11 | import { updateArray } from "../utils/updateArray"; |
12 | 12 |
|
13 | 13 | export default function handleComponentPropertyChange( |
@@ -63,23 +63,26 @@ export default function handleComponentPropertyChange( |
63 | 63 | }); |
64 | 64 | console.debug("callRequests", callRequests); |
65 | 65 | if (callRequests.length) { |
66 | | - fetchApiResult(fetchCallbackCallResults, callRequests).then( |
67 | | - (callResultResult) => { |
68 | | - if (callResultResult.data) { |
69 | | - applyCallbackCallResults(callResultResult.data); |
| 66 | + fetchApiResult(fetchChangeRequests, callRequests).then( |
| 67 | + (changeRequestsResult) => { |
| 68 | + if (changeRequestsResult.data) { |
| 69 | + applyChangeRequests(changeRequestsResult.data); |
70 | 70 | } else { |
71 | | - console.error("callback failed:", callResultResult.error); |
72 | | - console.error(" for requests:", callRequests); |
| 71 | + console.error( |
| 72 | + "callback failed:", |
| 73 | + changeRequestsResult.error, |
| 74 | + "for call requests:", |
| 75 | + callRequests, |
| 76 | + ); |
73 | 77 | } |
74 | 78 | }, |
75 | 79 | ); |
76 | | - } else { |
77 | 80 | } |
78 | 81 | } |
79 | 82 |
|
80 | | -function applyCallbackCallResults(callResults: ChangeRequest[]) { |
81 | | - console.log("processing call results", callResults); |
82 | | - callResults.forEach(({ contribPoint, contribIndex, changes }) => { |
| 83 | +function applyChangeRequests(changeRequests: ChangeRequest[]) { |
| 84 | + console.log("processing call results", changeRequests); |
| 85 | + changeRequests.forEach(({ contribPoint, contribIndex, changes }) => { |
83 | 86 | console.log("processing output of", contribPoint, contribIndex, changes); |
84 | 87 | const contributionStatesRecord = |
85 | 88 | appStore.getState().contributionStatesRecord; |
|
0 commit comments