pg_rails 7.2.1 → 7.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20cb7ade648f78aa73ed631d9732326edc5a251a36141d054084366d9a6b9859
|
4
|
+
data.tar.gz: 38c923c5650e20ecb6be91b304ec3014cbd189976b254500275f5d2bf77ea9a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 156c1e465ab38406145f7d3bddf65fa0e40bf28a16109c15eb41f623735032dd23f7ddfb4a3341abbe8167ffd065082aef10945c8181c38bb01c4c368aa1853e
|
7
|
+
data.tar.gz: 7691712c1641cceb9ed53b6740ad9650844b69056c8433c4b65eb149cc9014ebce8870583306ebe7ed55c23209ec6b762b1a6961225fd65281aa5ddeec133dad
|
@@ -13,6 +13,7 @@ export default class extends Controller {
|
|
13
13
|
|
14
14
|
today = yyyy + '-' + mm + '-' + dd
|
15
15
|
fechaEl.value = today
|
16
|
+
return fechaEl.value
|
16
17
|
}
|
17
18
|
|
18
19
|
closePopover () {
|
@@ -21,6 +22,12 @@ export default class extends Controller {
|
|
21
22
|
}
|
22
23
|
|
23
24
|
async submit () {
|
25
|
+
const fechaEl = document.getElementById(this.element.dataset.fieldId)
|
26
|
+
let startDate = fechaEl.value
|
27
|
+
if (!startDate) {
|
28
|
+
startDate = this.today()
|
29
|
+
}
|
30
|
+
|
24
31
|
const quantity = this.element.querySelector('input[name=quantity]').value
|
25
32
|
if (!quantity) {
|
26
33
|
this.closePopover()
|
@@ -28,8 +35,6 @@ export default class extends Controller {
|
|
28
35
|
}
|
29
36
|
const type = this.element.querySelector('select[name=type]').value
|
30
37
|
const direction = this.element.querySelector('select[name=direction]').value
|
31
|
-
const fechaEl = document.getElementById(this.element.dataset.fieldId)
|
32
|
-
const startDate = fechaEl.value
|
33
38
|
// console.log(quantity, type, direction)
|
34
39
|
this.element.querySelector('button').setAttribute('disabled', 'true')
|
35
40
|
// let input = this
|
@@ -49,9 +54,13 @@ export default class extends Controller {
|
|
49
54
|
this.element.querySelector('button').removeAttribute('disabled')
|
50
55
|
this.closePopover()
|
51
56
|
} else {
|
52
|
-
|
53
|
-
|
54
|
-
|
57
|
+
let message = 'Hubo un error'
|
58
|
+
try {
|
59
|
+
const json = await response.json
|
60
|
+
message = json.html || 'Hubo un error'
|
61
|
+
} catch {
|
62
|
+
// JSON parser error
|
63
|
+
}
|
55
64
|
flashMessage(message, 'warning', true)
|
56
65
|
this.element.querySelector('button').removeAttribute('disabled')
|
57
66
|
Rollbar.error('date jumper error', json)
|
data/pg_rails/lib/version.rb
CHANGED