|
|
|
@@ -49,7 +49,7 @@ class WikiPagesController < ApplicationController |
|
|
|
case change.action |
|
|
|
when ?= |
|
|
|
{ type: 'context', content: change.old_element } |
|
|
|
when ?| |
|
|
|
when ?! |
|
|
|
[{ type: 'removed', content: change.old_element }, |
|
|
|
{ type: 'added', content: change.new_element }] |
|
|
|
when ?+ |
|
|
|
@@ -98,13 +98,18 @@ class WikiPagesController < ApplicationController |
|
|
|
return head :unprocessable_entity if title.blank? || body.blank? |
|
|
|
|
|
|
|
page = WikiPage.find(params[:id]) |
|
|
|
base_revision_id = page.current_revision.id |
|
|
|
|
|
|
|
if params[:title].present? && params[:title].strip != page.title |
|
|
|
return head :unprocessable_entity |
|
|
|
end |
|
|
|
|
|
|
|
message = params[:message].presence |
|
|
|
Wiki::Commit.content!(page:, body:, created_user: current_user, message:) |
|
|
|
Wiki::Commit.content!(page:, |
|
|
|
body:, |
|
|
|
created_user: current_user, |
|
|
|
message:, |
|
|
|
base_revision_id:) |
|
|
|
|
|
|
|
head :ok |
|
|
|
end |
|
|
|
|