Skip to content

Commit

Permalink
Updated blog creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaitlyn Parkhurst committed Nov 3, 2021
1 parent 9af0514 commit c8551f1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
13 changes: 7 additions & 6 deletions Web/lib/BlogDB/Web.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,20 @@ sub startup ($self) {
$auth->post( '/user/settings/email' )->to( 'User#post_email' )->name( 'do_user_email' );

# /blog/ routes
$r->get ( '/blog/:name' )->to( 'Blog#get_blog' )->name( 'blog' );
$r->get ( '/blog/:name' )->to( 'Blog#get_blog' )->name( 'blog' ); # View A Specific Blog.

$auth->get ( '/blog/new' )->to( 'Blog#get_new_blogs' )->name( 'new_blogs' ); # List pending blogs for approval.
$r->post ( '/blog/new' )->to( 'Blog#post_new_blog' )->name( 'do_new_blog' ); # Create a new blog.
$r->get ( '/blog/new/:name' )->to( 'Blog#get_edit_blog' )->name( 'edit_new_blog' ); # Get the edit page for a new blog.
$r->post ( '/blog/new/:name' )->to( 'Blog#post_edit_blog' )->name( 'do_edit_new_blog' ); # Post an update with the edit page.

$auth->post( '/blog/:name/follow' )->to( 'Blog#post_follow' )->name( 'do_follow_blog' );
$auth->post( '/blog/:name/unfollow' )->to( 'Blog#post_unfollow' )->name( 'do_unfollow_blog' );
$auth->get ( '/blog/:name/settings' )->to( 'Blog#get_settings' )->name( 'blog_settings' );
$auth->post( '/blog/:name' )->to( 'Blog#post_settings' )->name( 'do_blog_settings' );
$auth->post( '/blog/:name/publish' )->to( 'Blog#post_publish' )->name( 'do_publish' );
$auth->post( '/blog/:name/unpublish' )->to( 'Blog#post_unpublish')->name( 'do_unpublish' );

# /new/
$r->post ( '/new' )->to( 'Create#post_new' )->name( 'do_add_new_blog' );
$r->get ( '/new/*name' )->to( 'Create#get_new_blog' )->name( 'update_new_blog' );
$r->post ( '/new/*name' )->to( 'Create#post_new_blog' )->name( 'do_update_new_blog');

# /tags/
$r->get ( '/tags' )->to( 'Tags#get_tags' )->name( 'tags' );
$auth->post( '/tags/suggest' )->to( 'Tags#post_suggest_tag')->name( 'do_suggest_tag' );
Expand Down
18 changes: 18 additions & 0 deletions Web/lib/BlogDB/Web/Controller/Blog.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,22 @@ sub post_unpublish ($c) {

}

# Handle New Blogs

sub get_new_blogs ($c) {

}

sub post_new_blog ($c) {

}

sub get_edit_new_blog ($c) {

}

sub post_edit_new_blog ($c) {

}

1;
22 changes: 0 additions & 22 deletions Web/lib/BlogDB/Web/Controller/Create.pm

This file was deleted.

0 comments on commit c8551f1

Please sign in to comment.