bugfixing economic calendar and remove endpoints
This commit is contained in:
parent
725466c234
commit
dbf8f9a3e2
@ -1291,10 +1291,10 @@ async def get_economic_calendar():
|
||||
ny_tz = pytz.timezone('America/New_York')
|
||||
today = datetime.now(ny_tz)
|
||||
|
||||
start_date = today - timedelta(weeks=1)
|
||||
start_date = today - timedelta(weeks=6)
|
||||
start_date = start_date - timedelta(days=(start_date.weekday() - 0) % 7)
|
||||
|
||||
end_date = today + timedelta(weeks=1)
|
||||
end_date = today + timedelta(weeks=6)
|
||||
end_date = end_date + timedelta(days=(4 - end_date.weekday()) % 7)
|
||||
|
||||
url = "https://api.benzinga.com/api/v2.1/calendar/economics"
|
||||
|
||||
@ -73,8 +73,6 @@ fastify.register(require("./delete-comment/server"), { pb });
|
||||
fastify.register(require("./delete-post/server"), { pb });
|
||||
fastify.register(require("./leaderboard/server"), { pb });
|
||||
fastify.register(require("./feedback/server"), { pb });
|
||||
fastify.register(require("./create-watchlist/server"), { pb });
|
||||
fastify.register(require("./delete-watchlist/server"), { pb });
|
||||
fastify.register(require("./edit-name-watchlist/server"), { pb });
|
||||
fastify.register(require("./create-strategy/server"), { pb });
|
||||
fastify.register(require("./delete-strategy/server"), { pb });
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
// Declare a route
|
||||
module.exports = function (fastify, opts, done) {
|
||||
|
||||
const pb = opts.pb;
|
||||
|
||||
fastify.post('/create-watchlist', async (request, reply) => {
|
||||
const data = request.body;
|
||||
let output;
|
||||
|
||||
try {
|
||||
output = await pb.collection("watchlist").create(data)
|
||||
}
|
||||
catch(e) {
|
||||
//console.log(e)
|
||||
output = [];
|
||||
}
|
||||
|
||||
|
||||
reply.send({ items: output })
|
||||
|
||||
});
|
||||
|
||||
done();
|
||||
};
|
||||
@ -1,25 +0,0 @@
|
||||
// Declare a route
|
||||
module.exports = function (fastify, opts, done) {
|
||||
|
||||
const pb = opts.pb;
|
||||
|
||||
fastify.post('/delete-watchlist', async (request, reply) => {
|
||||
const data = request.body;
|
||||
const watchListId = data?.watchListId
|
||||
let output;
|
||||
|
||||
try {
|
||||
await pb.collection("watchlist").delete(watchListId)
|
||||
output = 'success';
|
||||
}
|
||||
catch(e) {
|
||||
//console.log(e)
|
||||
output = 'failure';
|
||||
}
|
||||
|
||||
reply.send({ items: output })
|
||||
|
||||
});
|
||||
|
||||
done();
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user