mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: rename action_code_href to action_code_path (#14834)
Small actions should use path instead of absolute url. getURL function is necessary to insert a potential subfolder prefix.
This commit is contained in:
committed by
GitHub
parent
fc98d1edfa
commit
8b93da9fe0
@@ -79,7 +79,7 @@ class PostSerializer < BasicPostSerializer
|
||||
:is_auto_generated,
|
||||
:action_code,
|
||||
:action_code_who,
|
||||
:action_code_href,
|
||||
:action_code_path,
|
||||
:notice,
|
||||
:last_wiki_edit,
|
||||
:locked,
|
||||
@@ -444,12 +444,12 @@ class PostSerializer < BasicPostSerializer
|
||||
include_action_code? && action_code_who.present?
|
||||
end
|
||||
|
||||
def action_code_href
|
||||
post_custom_fields["action_code_href"]
|
||||
def action_code_path
|
||||
post_custom_fields["action_code_path"]
|
||||
end
|
||||
|
||||
def include_action_code_href?
|
||||
include_action_code? && action_code_href.present?
|
||||
def include_action_code_path?
|
||||
include_action_code? && action_code_path.present?
|
||||
end
|
||||
|
||||
def notice
|
||||
|
||||
@@ -29,7 +29,7 @@ class UserActionSerializer < ApplicationSerializer
|
||||
:post_type,
|
||||
:action_code,
|
||||
:action_code_who,
|
||||
:action_code_href,
|
||||
:action_code_path,
|
||||
:edit_reason,
|
||||
:category_id,
|
||||
:closed,
|
||||
@@ -91,12 +91,12 @@ class UserActionSerializer < ApplicationSerializer
|
||||
object.action_code_who
|
||||
end
|
||||
|
||||
def include_action_code_href?
|
||||
action_code_href.present?
|
||||
def include_action_code_path?
|
||||
action_code_path.present?
|
||||
end
|
||||
|
||||
def action_code_href
|
||||
object.action_code_href
|
||||
def action_code_path
|
||||
object.action_code_path
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user