2024-08-06 14:52:22 +00:00
|
|
|
import JSActionAPI from "ee/api/JSActionAPI";
|
2023-10-20 11:36:39 +00:00
|
|
|
import ActionAPI from "api/ActionAPI";
|
|
|
|
|
import type { ApiResponse } from "api/ApiResponses";
|
|
|
|
|
import type { Action } from "entities/Action";
|
2024-06-11 13:55:34 +00:00
|
|
|
import type { JSCollection } from "entities/JSCollection";
|
2023-10-20 11:36:39 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DO NOT ADD any additional code/functionality in this saga. This function is overridden in EE to
|
|
|
|
|
* use a different API for update action under the package editor.
|
|
|
|
|
* The purpose of this saga is only to call the appropriate API and return the result
|
|
|
|
|
* @param action Action
|
|
|
|
|
* @returns Action
|
|
|
|
|
*/
|
|
|
|
|
export function* updateActionAPICall(action: Action) {
|
|
|
|
|
try {
|
|
|
|
|
const response: ApiResponse<Action> = yield ActionAPI.updateAction(action);
|
|
|
|
|
|
|
|
|
|
return response;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
throw e;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-11 13:55:34 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* DO NOT ADD any additional code/functionality in this saga. This function is overridden in EE to
|
|
|
|
|
* use a different API for update jsCollection under the package editor.
|
|
|
|
|
* The purpose of this saga is only to call the appropriate API and return the result
|
|
|
|
|
* @param action Action
|
|
|
|
|
* @returns Action
|
|
|
|
|
*/
|
|
|
|
|
export function* updateJSCollectionAPICall(jsCollection: JSCollection) {
|
|
|
|
|
try {
|
|
|
|
|
const response: ApiResponse<JSCollection> =
|
|
|
|
|
yield JSActionAPI.updateJSCollection(jsCollection);
|
|
|
|
|
|
|
|
|
|
return response;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
throw e;
|
|
|
|
|
}
|
|
|
|
|
}
|