fix: small fixes for threads

This commit is contained in:
KernelDeimos
2025-03-05 16:55:09 -05:00
parent 53c865c973
commit 96199cbb54
3 changed files with 4 additions and 4 deletions

View File

@@ -280,7 +280,7 @@ class ThreadService extends BaseService {
}).attach(router);
Endpoint({
route: '/delete/:uid',
route: '/:uid',
methods: ['DELETE'],
mw: [configurable_auth()],
handler: async (req, res) => {

View File

@@ -8,12 +8,12 @@ export default class Perms {
async req_ (route, body) {
const resp = await fetch(
this.APIOrigin + route, {
method: 'POST',
method: body ? 'POST' : 'GET',
headers: {
Authorization: `Bearer ${this.authToken}`,
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
...(body ? { body: JSON.stringify(body) } : {}),
}
);
return await resp.json();

View File

@@ -39,7 +39,7 @@ export default class Threads {
}
async list (uid, page, options) {
await this.req_('POST',
return await this.req_('POST',
'/threads/list/' + encodeURIComponent(uid) + '/' + page,
options ?? {},
);