Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
Nicolai Ort | b871e4295d | |
Nicolai Ort | 0945060a49 | |
Nicolai Ort | f7eae96b8c | |
Nicolai Ort | c2a50a1480 | |
Nicolai Ort | bb99c2dcd1 |
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -2,8 +2,18 @@
|
|||
|
||||
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
|
||||
|
||||
#### [0.5.1](https://git.odit.services/kauft.es/linkylinky/compare/0.5.0...0.5.1)
|
||||
|
||||
- Added endpoint to query over all visited urls [`bb99c2d`](https://git.odit.services/kauft.es/linkylinky/commit/bb99c2dcd1ce89af1bc27a035be5265345d2a05f)
|
||||
- Added optional filtering by provider [`0945060`](https://git.odit.services/kauft.es/linkylinky/commit/0945060a49ed35c038df2c04bbd07174bc5654ca)
|
||||
- Shortened return to avoid variable memory asignment [`f7eae96`](https://git.odit.services/kauft.es/linkylinky/commit/f7eae96b8c3479d333fc00bc36bce451733700db)
|
||||
- Changed object property order (just for us pesky humans to improve readability) [`c2a50a1`](https://git.odit.services/kauft.es/linkylinky/commit/c2a50a14807e223987464c63fac6d67ed98b1a93)
|
||||
|
||||
#### [0.5.0](https://git.odit.services/kauft.es/linkylinky/compare/0.4.3...0.5.0)
|
||||
|
||||
> 21 August 2021
|
||||
|
||||
- 🚀RELEASE 0.5.0 [`e8382fb`](https://git.odit.services/kauft.es/linkylinky/commit/e8382fb579f769364693974cbe74ce06e9810a9a)
|
||||
- Removed visits 404 resolution [`59e1784`](https://git.odit.services/kauft.es/linkylinky/commit/59e178476e8f7e64de92ae23e859b87680e7af64)
|
||||
- Added migration for visits provider [`f48159b`](https://git.odit.services/kauft.es/linkylinky/commit/f48159b31bcaf7c7449c89fb1e3851bcb04f5e3c)
|
||||
- Reverted last change since we can defer it from the provider [`b532137`](https://git.odit.services/kauft.es/linkylinky/commit/b5321377bde9bd7de13e2eee4dd38a072cf0d4a3)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@odit/shortener-backend",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
|
|
|
@ -267,7 +267,7 @@ fastify.post('/api/auth/register', async (req, res) => {
|
|||
|
||||
//Anything in here has some kind of auth
|
||||
fastify.after(() => {
|
||||
//Get url api route
|
||||
//Get url visits api route
|
||||
fastify.get('/api/:shortcode/visits', { onRequest: fastify.auth([fastify.basicAuth, fastify.verifyJWT]) }, async (req, res) => {
|
||||
const shortcode = req.params.shortcode;
|
||||
|
||||
|
@ -283,6 +283,17 @@ fastify.after(() => {
|
|||
return visits;
|
||||
});
|
||||
|
||||
//Get all visits api route
|
||||
fastify.get('/api/visits', { onRequest: fastify.auth([fastify.basicAuth, fastify.verifyJWT]) }, async (req, res) => {
|
||||
if(req.query.provider){
|
||||
return await knex.select('shortcode', 'provider', 'timestamp')
|
||||
.from('visits')
|
||||
.where("provider", "=", req.query.provider);
|
||||
}
|
||||
return await knex.select('shortcode', 'provider', 'timestamp')
|
||||
.from('visits');
|
||||
});
|
||||
|
||||
//Get url api route
|
||||
fastify.delete('/api/:shortcode', { onRequest: fastify.auth([fastify.basicAuth, fastify.verifyJWT]) }, async (req, res) => {
|
||||
const shortcode = req.params.shortcode;
|
||||
|
|
Loading…
Reference in New Issue