mirror of
https://github.com/HeyPuter/puter.git
synced 2025-12-30 17:50:00 -06:00
fix: small fixes for threads
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 ?? {},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user