File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
app/javascript/components/vm-edit-form Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ const VmEditForm = ({
18
18
if ( displayName === 'Image' || displayName === 'Instance' ) {
19
19
returnURL = '/vm_cloud/explorer/' ;
20
20
}
21
+
22
+ let URL = `/api/vms/${ recordId } ` ;
23
+ if ( isTemplate ) {
24
+ URL = `/api/templates/${ recordId } ` ;
25
+ }
26
+
21
27
const [ {
22
28
initialValues, parentOptions, isLoading,
23
29
} , setState ] = useState ( {
@@ -43,7 +49,6 @@ const VmEditForm = ({
43
49
/** Function to update just the description of the record on form submit. */
44
50
const updateDescription = ( values ) => {
45
51
const data = descriptionData ( values ) ;
46
- const URL = `/api/vms/${ recordId } ` ;
47
52
return API . post ( URL , data )
48
53
. then ( ( ) => {
49
54
miqSparkleOn ( ) ;
@@ -56,10 +61,6 @@ const VmEditForm = ({
56
61
/** Function to update the entire record on form submit. */
57
62
const updateRecord = ( values ) => {
58
63
const data = getSubmitData ( values ) ;
59
- let URL = `/api/vms/${ recordId } ` ;
60
- if ( isTemplate ) {
61
- URL = `/api/templates/${ recordId } ` ;
62
- }
63
64
return API . post ( URL , data )
64
65
. then ( ( ) => {
65
66
miqSparkleOn ( ) ;
You can’t perform that action at this time.
0 commit comments