sinatra-hexacta 1.7.18 → 1.7.19
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: 3e2a48f9974554c9e3d2f4c27c4b0378b301244a4dee41f07fbfc217ce1d450e
|
4
|
+
data.tar.gz: 7f208d02ad3db6a73d5a4191f518ee79799d79014ce4afe7e17260bd4fcf7821
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6e04096184e17f002bd542fd08d173af4af41cd2d0525931d1be2136b244fe23e67bc425834995037a512496cfb7405b7c606ad1080c6a34c1f947020221b5f
|
7
|
+
data.tar.gz: c663c87d329a6c49b6915deaa82fa91409ba96ebdbc86f0740d6e6cad8e1eb728389e8656ae5702dd2b8db7e443a64107eab19292406e3ad978058bf75dc7820
|
@@ -37,7 +37,9 @@ module Sinatra
|
|
37
37
|
end
|
38
38
|
|
39
39
|
delete '/notifications/:id' do |id|
|
40
|
-
Notification.find(:user_id => authenticated(User).id, :id => id)
|
40
|
+
notification = Notification.find(:user_id => authenticated(User).id, :id => id)
|
41
|
+
error(404) if notification.nil?
|
42
|
+
notification.destroy.to_hash.to_json.to_s
|
41
43
|
end
|
42
44
|
|
43
45
|
delete '/notifications' do
|
@@ -60,11 +60,16 @@ module Sinatra
|
|
60
60
|
end
|
61
61
|
|
62
62
|
get '/reports/:report_name' do |report_name|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
"Content-
|
67
|
-
|
63
|
+
begin
|
64
|
+
date = Date.parse(params[:date]) unless params[:date].nil?
|
65
|
+
date ||= Date.today
|
66
|
+
headers "Content-Disposition" => "attachment;filename=#{report_name}.#{date}.xls",
|
67
|
+
"Content-Type" => "application/octet-stream"
|
68
|
+
slim "reports/#{report_name}".to_sym, locals: { :date => date }, :stream => true, :layout => false
|
69
|
+
rescue Exception => e
|
70
|
+
NotificationSender.instance.send_error(authenticated(User),e.message,e.backtrace.join('\n'))
|
71
|
+
halt 400, e.message
|
72
|
+
end
|
68
73
|
end
|
69
74
|
end
|
70
75
|
|