Skip to content

Commit

Permalink
Add integer requirements to post routes
Browse files Browse the repository at this point in the history
  • Loading branch information
melroy89 committed Oct 1, 2024
1 parent ddb0280 commit c1bab1a
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions config/kbin_routes/post.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,108 +3,155 @@ post_comment_create:
defaults: { slug: -, parent_comment_id: null }
path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{parent_comment_id}
methods: [ GET, POST ]
requirements:
post_id: \d+
parent_comment_id: \d+

post_comment_edit:
controller: App\Controller\Post\Comment\PostCommentEditController
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/edit
methods: [ GET, POST ]
requirements:
post_id: \d+
comment_id: \d+

post_comment_moderate:
controller: App\Controller\Post\Comment\PostCommentModerateController
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/moderate
methods: [ GET, POST ]
requirements:
post_id: \d+
comment_id: \d+

post_comment_delete:
controller: App\Controller\Post\Comment\PostCommentDeleteController::delete
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/delete
methods: [ POST ]
requirements:
post_id: \d+
comment_id: \d+

post_comment_restore:
controller: App\Controller\Post\Comment\PostCommentDeleteController::restore
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/restore
methods: [ POST ]
requirements:
post_id: \d+
comment_id: \d+

post_comment_purge:
controller: App\Controller\Post\Comment\PostCommentDeleteController::purge
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/purge
methods: [ POST ]
requirements:
post_id: \d+
comment_id: \d+

post_comment_change_lang:
controller: App\Controller\Post\Comment\PostCommentChangeLangController
defaults: { slug: - }
path: /m/{magazine_name}/p/{post_id}/{slug}/comments/{comment_id}/change_lang
methods: [ POST ]
requirements:
post_id: \d+
comment_id: \d+

post_comment_change_adult:
controller: App\Controller\Post\Comment\PostCommentChangeAdultController
defaults: { slug: - }
path: /m/{magazine_name}/p/{post_id}/{slug}/comments/{comment_id}/change_adult
methods: [ POST ]
requirements:
post_id: \d+
comment_id: \d+

post_comment_image_delete:
controller: App\Controller\Post\Comment\PostCommentDeleteImageController
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/delete_image
methods: [ POST ]
requirements:
post_id: \d+
comment_id: \d+

post_comment_voters:
controller: App\Controller\Post\Comment\PostCommentVotersController
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/votes
methods: [ GET ]
requirements:
post_id: \d+
comment_id: \d+

post_comment_favourites:
controller: App\Controller\Post\Comment\PostCommentFavouriteController
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/reply/{comment_id}/favourites
methods: [ GET ]
requirements:
post_id: \d+
comment_id: \d+

post_comment_vote:
controller: App\Controller\VoteController
defaults: { entityClass: App\Entity\PostComment }
path: /pcv/{id}/{choice}
methods: [ POST ]
requirements:
id: \d+

post_comment_report:
controller: App\Controller\ReportController
defaults: { entityClass: App\Entity\PostComment }
path: /pcr/{id}
methods: [ GET, POST ]
requirements:
id: \d+

post_comment_favourite:
controller: App\Controller\FavouriteController
defaults: { entityClass: App\Entity\PostComment }
path: /pcf/{id}
methods: [ POST ]
requirements:
id: \d+

post_comment_boost:
controller: App\Controller\BoostController
defaults: { entityClass: App\Entity\PostComment }
path: /pcb/{id}
methods: [ POST ]
requirements:
id: \d+

post_pin:
controller: App\Controller\Post\PostPinController
defaults: { slug: - }
path: /m/{magazine_name}/p/{post_id}/{slug}/pin
methods: [ POST ]
requirements:
post_id: \d+

post_voters:
controller: App\Controller\Post\PostVotersController
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/votes
methods: [ GET ]
requirements:
post_id: \d+

post_favourites:
controller: App\Controller\Post\PostFavouriteController
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/favourites
methods: [ GET ]
requirements:
post_id: \d+

post_create:
controller: App\Controller\Post\PostCreateController
Expand All @@ -116,54 +163,72 @@ post_edit:
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/edit
methods: [ GET, POST ]
requirements:
post_id: \d+

post_moderate:
controller: App\Controller\Post\PostModerateController
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/moderate
methods: [ GET, POST ]
requirements:
post_id: \d+

post_delete:
controller: App\Controller\Post\PostDeleteController::delete
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/delete
methods: [ POST ]
requirements:
post_id: \d+

post_restore:
controller: App\Controller\Post\PostDeleteController::restore
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/restore
methods: [ POST ]
requirements:
post_id: \d+

post_purge:
controller: App\Controller\Post\PostDeleteController::purge
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/purge
methods: [ POST ]
requirements:
post_id: \d+

post_image_delete:
controller: App\Controller\Post\PostDeleteImageController
defaults: { slug: -, }
path: /m/{magazine_name}/p/{post_id}/{slug}/delete_image
methods: [ POST ]
requirements:
post_id: \d+

post_change_magazine:
controller: App\Controller\Post\PostChangeMagazineController
defaults: { slug: - }
path: /m/{magazine_name}/p/{post_id}/{slug}/change_magazine
methods: [ POST ]
requirements:
post_id: \d+

post_change_lang:
controller: App\Controller\Post\PostChangeLangController
defaults: { slug: - }
path: /m/{magazine_name}/p/{post_id}/{slug}/change_lang
methods: [ POST ]
requirements:
post_id: \d+

post_change_adult:
controller: App\Controller\Post\PostChangeAdultController
defaults: { slug: - }
path: /m/{magazine_name}/p/{post_id}/{slug}/change_adult
methods: [ POST ]
requirements:
post_id: \d+

post_single:
controller: App\Controller\Post\PostSingleController
Expand All @@ -172,27 +237,36 @@ post_single:
methods: [ GET ]
requirements:
sortBy: "%comment_sort_options%"
post_id: \d+

post_vote:
controller: App\Controller\VoteController
defaults: { entityClass: App\Entity\Post }
path: /pv/{id}/{choice}
methods: [ POST ]
requirements:
id: \d+

post_report:
controller: App\Controller\ReportController
defaults: { entityClass: App\Entity\Post }
path: /pr/{id}
methods: [ GET, POST ]
requirements:
id: \d+

post_favourite:
controller: App\Controller\FavouriteController
defaults: { entityClass: App\Entity\Post }
path: /pf/{id}
methods: [ POST ]
requirements:
id: \d+

post_boost:
controller: App\Controller\BoostController
defaults: { entityClass: App\Entity\Post }
path: /pb/{id}
methods: [ POST ]
requirements:
id: \d+

0 comments on commit c1bab1a

Please sign in to comment.