Skip to content

Commit

Permalink
fix article editor js
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Aug 11, 2023
1 parent 2513933 commit e3a9c01
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 11 additions & 1 deletion app/controllers/articles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,18 @@ def update
end

def mine
@posts = current_user.posts

@tab = params[:tab] || "all"
case @tab
when "all"
@posts = current_user.posts
when "published"
@posts = current_user.posts.published
else "draft"
@posts = current_user.posts.draft
end

@posts.page(params[:page]).per(10)
end

private
Expand Down
4 changes: 1 addition & 3 deletions app/javascript/controllers/editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ function EditorComponent({callback, ctx, upload, initialValue}){
ImageBlockConfig({
options: {
upload_handler: (file, ctx) => {
console.log("UPLOADED FILE!!!!", file)

this.upload(file, (blob)=>{
upload(file, (blob)=>{
console.log(blob)
console.log(ctx)
ctx.updateAttributes({
Expand Down

0 comments on commit e3a9c01

Please sign in to comment.