mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-29 00:38:11 -05:00
Don't base copy/rename API URLs on the "from" multi path.
Since "copy" and "rename" are operations rather than resources underneath the multi, let's put them in the root of the API namespace.
This commit is contained in:
@@ -321,8 +321,8 @@ def make_map():
|
||||
mc('/api/:action', controller='api')
|
||||
|
||||
mc("/api/multi/mine", controller="multiapi", action="my_multis")
|
||||
mc("/api/multi/*multipath/copy", controller="multiapi", action="multi_copy")
|
||||
mc("/api/multi/*multipath/rename", controller="multiapi", action="multi_rename")
|
||||
mc("/api/multi/copy", controller="multiapi", action="multi_copy")
|
||||
mc("/api/multi/rename", controller="multiapi", action="multi_rename")
|
||||
mc("/api/multi/*multipath/r/:srname", controller="multiapi", action="multi_subreddit")
|
||||
mc("/api/multi/*multipath/description", controller="multiapi", action="multi_description")
|
||||
mc("/api/multi/*multipath", controller="multiapi", action="multi")
|
||||
|
||||
@@ -222,7 +222,7 @@ class MultiApiController(RedditController, OAuth2ResourceController):
|
||||
@validate(
|
||||
VUser(),
|
||||
VModhash(),
|
||||
from_multi=VMultiByPath("multipath", require_view=True),
|
||||
from_multi=VMultiByPath("from", require_view=True),
|
||||
to_path_info=VMultiPath("to",
|
||||
docs={"to": "destination multireddit url path"},
|
||||
),
|
||||
@@ -256,7 +256,7 @@ class MultiApiController(RedditController, OAuth2ResourceController):
|
||||
@validate(
|
||||
VUser(),
|
||||
VModhash(),
|
||||
from_multi=VMultiByPath("multipath", require_edit=True),
|
||||
from_multi=VMultiByPath("from", require_edit=True),
|
||||
to_path_info=VMultiPath("to",
|
||||
docs={"to": "destination multireddit url path"},
|
||||
),
|
||||
|
||||
@@ -147,8 +147,9 @@ r.multi.MultiReddit = Backbone.Model.extend({
|
||||
var deferred = new $.Deferred
|
||||
Backbone.ajax({
|
||||
type: 'POST',
|
||||
url: this.url() + '/' + op,
|
||||
url: '/api/multi/' + op,
|
||||
data: {
|
||||
from: this.get('path'),
|
||||
to: newCollection.pathByName(newName)
|
||||
},
|
||||
success: _.bind(function(resp) {
|
||||
|
||||
Reference in New Issue
Block a user