Skip to content

Commit 96199cb

Browse files
committed
fix: small fixes for threads
1 parent 53c865c commit 96199cb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/backend/src/services/ThreadService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class ThreadService extends BaseService {
280280
}).attach(router);
281281

282282
Endpoint({
283-
route: '/delete/:uid',
283+
route: '/:uid',
284284
methods: ['DELETE'],
285285
mw: [configurable_auth()],
286286
handler: async (req, res) => {

src/puter-js/src/modules/Perms.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export default class Perms {
88
async req_ (route, body) {
99
const resp = await fetch(
1010
this.APIOrigin + route, {
11-
method: 'POST',
11+
method: body ? 'POST' : 'GET',
1212
headers: {
1313
Authorization: `Bearer ${this.authToken}`,
1414
'Content-Type': 'application/json',
1515
},
16-
body: JSON.stringify(body),
16+
...(body ? { body: JSON.stringify(body) } : {}),
1717
}
1818
);
1919
return await resp.json();

src/puter-js/src/modules/Threads.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default class Threads {
3939
}
4040

4141
async list (uid, page, options) {
42-
await this.req_('POST',
42+
return await this.req_('POST',
4343
'/threads/list/' + encodeURIComponent(uid) + '/' + page,
4444
options ?? {},
4545
);

0 commit comments

Comments
 (0)