imports/vx/server/code/vxapp.js
/**
     * For RESTORE deployment action, return an array of snapshots in a
     * form used to populate the snapshot dropdown.
     *
     * @param {object} formObject Form object from deployment modal.
     * @return {object} Result object.
     */
For RESTORE deployment action, return an array of snapshots in a
form used to populate the snapshot dropdown.

@param {object} formObject Form object from deployment modal.
@return {object} Result object.
For RESTORE deployment action return an array of snapshots in a form used to populate the snapshot dropdown . @param { object } formObject Form object from deployment modal . @return { object } Result object .
makeSnapshotArray(formObject) {
        try {
            const targetDomainName = Util.fetchDomainName(formObject.targetDomain)
            let history = History.findOne( { domain: formObject.targetDomain } )
            if (!history) {
                return { success : false, key : "common.alert_deployment_message_no_history", variables : { targetDomainName } }
            }
            const snapshotArray = history.snapshots.map((snapshot, index) => {
                return { code: index, localized : Util.i18n("common.alert_deployment_snapshot_option",
                    { targetDomainName, dateTime : Util.formatDateTime(snapshot.date) } ) }
            })
            snapshotArray.sort((recordA, recordB) => {
                return recordB.code - recordA.code
            })
            snapshotArray.unshift( { code: "", localized: "" } )
            return { success : true, snapshotArray }
        }
        catch (error) {
            OLog.error(`vxapp.js makeSnapshotArray unexpected error=${error}`)
            return { success : false, icon : "BUG", key : "common.alert_unexpected_error", variables : { error : error.toString() } }
        }
    }
makeSnapshotArray ( formObject ) { try { const targetDomainName = Util . fetchDomainName ( formObject . targetDomain ) let history = History . findOne ( { domain : formObject . targetDomain } ) if ( ! history ) { return { success : false , key : "common.alert_deployment_message_no_history" , variables : { targetDomainName } } } const snapshotArray = history . snapshots . map ( ( snapshot , index ) => { return { code : index , localized : Util . i18n ( "common.alert_deployment_snapshot_option" , { targetDomainName , dateTime : Util . formatDateTime ( snapshot . date ) } ) } } ) snapshotArray . sort ( ( recordA , recordB ) => { return recordB . code - recordA . code } ) snapshotArray . unshift ( { code : "" , localized : "" } ) return { success : true , snapshotArray } } catch ( error ) { OLog . error ( ` ${ error } ` ) return { success : false , icon : "BUG" , key : "common.alert_unexpected_error" , variables : { error : error . toString ( ) } } } }
For RESTORE deployment action, return an array of snapshots in a
 form used to populate the snapshot dropdown.
For RESTORE deployment action return an array of snapshots in a form used to populate the snapshot dropdown .