<p dir="auto">Part 4 of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2610276342" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5283" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/5283/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/5283">#5283</a></p>
<p dir="auto">Adds API endpoints to subscribe/unsubscribe from a note.</p>
<p dir="auto">This is like the changeset subscribe/unsubscribe<br>
<a href="https://wiki.openstreetmap.org/wiki/API_v0.6#Subscribe:_POST_/api/0.6/changeset/#id/subscribe" rel="nofollow">https://wiki.openstreetmap.org/wiki/API_v0.6#Subscribe:_POST_/api/0.6/changeset/#id/subscribe</a><br>
but since we like resourceful routes, instead of <code class="notranslate">POST .../subscribe</code> and <code class="notranslate">POST .../unsubscribe</code>, this PR adds:</p>
<ul dir="auto">
<li><code class="notranslate">POST /api/0.6/notes/:id/subscription</code> to add a subscription</li>
<li><code class="notranslate">DELETE /api/0.6/notes/:id/subscription</code> to remove a subscription</li>
</ul>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5314'>https://github.com/openstreetmap/openstreetmap-website/pull/5314</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5314/commits/3ecf7943b36836b9f0337aa9d7c8f48992293ae8" class="commit-link">3ecf794</a> Add create note subscription api endpoint</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5314/commits/bc8c005d6186c56054fc68d8281e67ba8efb76cc" class="commit-link">bc8c005</a> Add destroy note subscription api endpoint</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5314/files">4 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5314/files#diff-38488bd50be0cf63517ec5ae3fd3c4e462b3fdda7201844b0ab3442b73b8c08d">app/abilities/api_capability.rb</a>
(1)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5314/files#diff-c6e6328228ce076caaf2ab687540a8bd8260930be2129e8ba1ff1b254b19beb9">app/controllers/api/note_subscriptions_controller.rb</a>
(22)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5314/files#diff-959bc9abc46a55332bb64d5155a79323afa75a50ec1a2137ddd22d926f62c6c5">config/routes.rb</a>
(2)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5314/files#diff-ba48d2f4593acf4786d7b02e0b24483b8335a16421ec415653fb177b0a0231c2">test/controllers/api/note_subscriptions_controller_test.rb</a>
(132)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5314.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5314.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5314.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5314.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5314">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLWZIOH6CYT7BI2YKL2AKCLVAVCNFSM6AAAAABRVEQ2BGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY2TGNJXGMYTQMQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLLWRY434RQ7ACHG2CL2AKCLVA5CNFSM6AAAAABRVEQ2BGWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHJ4KSQHY.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5314</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5314",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5314",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>