Skip to content

Commit 01ba616

Browse files
committed
dev: make thread endpoints more conventional
1 parent 9f3ce50 commit 01ba616

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/backend/src/services/ThreadService.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ class ThreadService extends BaseService {
214214
}).attach(router);
215215

216216
Endpoint({
217-
route: '/edit',
218-
methods: ['POST'],
217+
route: '/edit/:uid',
218+
methods: ['PUT'],
219219
mw: [configurable_auth()],
220220
handler: async (req, res) => {
221221
const text = req.body.text;
@@ -235,7 +235,7 @@ class ThreadService extends BaseService {
235235
});
236236
}
237237

238-
const uid = req.body.uid;
238+
const uid = req.params.uid;
239239

240240
if ( ! is_valid_uuid(uid) ) {
241241
throw APIError.create('field_invalid', null, {
@@ -280,11 +280,11 @@ class ThreadService extends BaseService {
280280
}).attach(router);
281281

282282
Endpoint({
283-
route: '/delete',
284-
methods: ['POST'],
283+
route: '/delete/:uid',
284+
methods: ['DELETE'],
285285
mw: [configurable_auth()],
286286
handler: async (req, res) => {
287-
const uid = req.body.uid;
287+
const uid = req.params.uid;
288288

289289
if ( ! is_valid_uuid(uid) ) {
290290
throw APIError.create('field_invalid', null, {

0 commit comments

Comments
 (0)