Skip to content

Commit cc351d7

Browse files
author
Aleksei Burlakov
committed
Dev: add created/updated/delete flash url argument to notify the hawk-apserver
The created/updated/delete status is kept in the rails internal cookies, which are not accessible from hawk-apiserver. However, newer versions of hawk require this status.
1 parent 42b4a40 commit cc351d7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

hawk/app/controllers/primitives_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def create
4848
format.html do
4949
flash[:success] = _("Primitive created successfully")
5050
if @primitive.parent.blank?
51-
redirect_to edit_cib_primitive_url(cib_id: @cib.id, id: @primitive.id)
51+
redirect_to edit_cib_primitive_url(cib_id: @cib.id, id: @primitive.id, flash: "created")
5252
else
5353
redirect_to edit_cib_group_url(cib_id: @cib.id, id: @primitive.parent)
5454
end
@@ -108,7 +108,7 @@ def update
108108

109109
format.html do
110110
flash[:success] = _("Primitive updated successfully")
111-
redirect_to edit_cib_primitive_url(cib_id: @cib.id, id: @primitive.id)
111+
redirect_to edit_cib_primitive_url(cib_id: @cib.id, id: @primitive.id, flash: "updated")
112112
end
113113
format.json do
114114
render json: @primitive, status: :updated

hawk/app/controllers/resources_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def status
6363
end
6464

6565
def types
66+
flash[:success] = _("Primitive deleted successfully") if params[:flash] == "deleted"
67+
6668
respond_to do |format|
6769
format.html
6870
end

0 commit comments

Comments
 (0)