diff options
| author | rr- | 2016-10-21 21:48:08 +0200 |
|---|---|---|
| committer | rr- | 2016-10-21 21:48:38 +0200 |
| commit | 9d6a0e0173831a6284be89cf71c1e627b4d8c0c9 (patch) | |
| tree | ccd1c651370c974d1a50e6d605bdd54acda6f860 /API.md | |
| parent | 85d6934ae9fcc0b660433d9094b6cd63824d2409 (diff) | |
server/posts: add post merging
Diffstat (limited to 'API.md')
| -rw-r--r-- | API.md | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -36,6 +36,7 @@ - [Updating post](#updating-post) - [Getting post](#getting-post) - [Deleting post](#deleting-post) + - [Merging posts](#merging-posts) - [Rating post](#rating-post) - [Adding post to favorites](#adding-post-to-favorites) - [Removing post from favorites](#removing-post-from-favorites) @@ -910,6 +911,40 @@ data. Deletes existing post. Related posts and tags are kept. +## Merging posts +- **Request** + + `POST /post-merge/` + +- **Input** + + ```json5 + { + "removeVersion": <source-post-version>, + "remove": <source-post-id>, + "mergeToVersion": <target-post-version>, + "mergeTo": <target-post-id> + } + ``` + +- **Output** + + A [post resource](#post) containing the merged post. + +- **Errors** + + - the version of either post is outdated + - the source or target post does not exist + - the source post is the same as the target post + - privileges are too low + +- **Description** + + Removes source post and merges all of its tags, relations, scores, + favorites and comments to the target post. Source post properties such as + its content, safety, source, whether to loop the video and other scalar + values do not get transferred and are discarded. + ## Rating post - **Request** |