bugfixing: remove endpoint
This commit is contained in:
parent
7a4033a597
commit
35b1e1c663
@ -1,29 +0,0 @@
|
|||||||
// Declare a route
|
|
||||||
module.exports = function (fastify, opts, done) {
|
|
||||||
|
|
||||||
const pb = opts.pb;
|
|
||||||
|
|
||||||
fastify.post('/edit-name-watchlist', async (request, reply) => {
|
|
||||||
const data = request.body;
|
|
||||||
const watchListId = data?.watchListId;
|
|
||||||
const newTitle = data?.title;
|
|
||||||
|
|
||||||
let output;
|
|
||||||
|
|
||||||
try {
|
|
||||||
await pb.collection("watchlist").update(watchListId, {
|
|
||||||
'title': newTitle
|
|
||||||
})
|
|
||||||
output = 'success';
|
|
||||||
}
|
|
||||||
catch(e) {
|
|
||||||
//console.log(e)
|
|
||||||
output = 'failure';
|
|
||||||
}
|
|
||||||
|
|
||||||
reply.send({ items: output })
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
done();
|
|
||||||
};
|
|
||||||
Loading…
x
Reference in New Issue
Block a user