refactor: started work on porting socket methods to write API [breaking]

The following socket calls have been removed:

* `posts.getRawPost`
* `posts.getPostSummaryByPid`

Two new Write API routes have been added:

- `GET /api/v3/posts/:pid/raw`
- `GET /api/v3/posts/:pid/summary`
This commit is contained in:
Julian Lam
2023-04-12 17:17:45 -04:00
parent f0d989e4ba
commit f2082d7de8
7 changed files with 100 additions and 64 deletions

View File

@@ -315,7 +315,7 @@ define('forum/topic', [
destroyed = false;
async function renderPost(pid) {
const postData = postCache[pid] || await socket.emit('posts.getPostSummaryByPid', { pid: pid });
const postData = postCache[pid] || await api.get(`/posts/${pid}/summary`);
$('#post-tooltip').remove();
if (postData && ajaxify.data.template.topic) {
postCache[pid] = postData;