Skip to content

Commit ae0049b

Browse files
authored
Merge pull request #1751 from codidact/0valt/545/silent-tag-rename-fix
fixed lack of visible error when trying to rename a tag to an invalid…
2 parents 30541d5 + 7ba023d commit ae0049b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/assets/javascripts/tags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ $(() => {
202202
location.reload();
203203
}
204204
else {
205-
console.error('Failed to rename tag, somehow');
205+
QPixel.createNotification('danger', `Failed to rename the tag. (${resp.status})`);
206206
}
207207
}
208208
});

app/controllers/tags_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def rename
141141
end
142142
end
143143

144-
render json: { success: status, tag: @tag }
144+
render json: { success: status, tag: @tag }, status: status ? :ok : :bad_request
145145
end
146146

147147
def select_merge; end

test/controllers/tags_controller_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class TagsControllerTest < ActionController::TestCase
215215
tag: tag
216216
}
217217

218-
assert_response(:success)
218+
assert_response(:bad_request)
219219
assert_valid_json_response
220220

221221
res_body = JSON.parse(response.body)

0 commit comments

Comments
 (0)