* Closes a script by removing its order property * @param {string} appId - The application ID * @param {number} scriptId - The script ID to close * @returns {Promise}
(appId, scriptId)
| 127 | * @returns {Promise} |
| 128 | */ |
| 129 | async closeScript(appId, scriptId) { |
| 130 | const allScripts = await this.getScripts(appId); |
| 131 | const updatedScripts = allScripts.map(script => |
| 132 | script.id === scriptId |
| 133 | ? { ...script, order: undefined } |
| 134 | : script |
| 135 | ); |
| 136 | await this.saveScripts(appId, updatedScripts); |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Updates the order of open scripts |
no test coverage detected