mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/routing: move routing to controllers
This commit is contained in:
@ -1,8 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
const page = require('page');
|
||||
const topNavController = require('../controllers/top_nav_controller.js');
|
||||
|
||||
class PostsController {
|
||||
registerRoutes() {
|
||||
page('/upload', (ctx, next) => { this.uploadPostsRoute(); });
|
||||
page('/posts', (ctx, next) => { this.listPostsRoute(); });
|
||||
page(
|
||||
'/post/:id',
|
||||
(ctx, next) => { this.showPostRoute(ctx.params.id); });
|
||||
page(
|
||||
'/post/:id/edit',
|
||||
(ctx, next) => { this.editPostRoute(ctx.params.id); });
|
||||
}
|
||||
|
||||
uploadPostsRoute() {
|
||||
topNavController.activate('upload');
|
||||
}
|
||||
|
Reference in New Issue
Block a user