mirror of
https://github.com/ArthurDanjou/artdanj-shortener.git
synced 2026-01-14 15:54:08 +01:00
Fixing some bugs
This commit is contained in:
@@ -22,6 +22,7 @@ export default class LinksController {
|
|||||||
await link.load('author', (query) => {
|
await link.load('author', (query) => {
|
||||||
query.select('email')
|
query.select('email')
|
||||||
})
|
})
|
||||||
|
await link.load('clicks')
|
||||||
return response.status(200).send({
|
return response.status(200).send({
|
||||||
link
|
link
|
||||||
})
|
})
|
||||||
@@ -60,6 +61,7 @@ export default class LinksController {
|
|||||||
.preload('author', (query) => {
|
.preload('author', (query) => {
|
||||||
query.select('email')
|
query.select('email')
|
||||||
})
|
})
|
||||||
|
.preload('clicks')
|
||||||
return response.status(200).send({
|
return response.status(200).send({
|
||||||
links
|
links
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -44,6 +44,6 @@ export default class Update extends BaseCommand {
|
|||||||
link.expire = DateTime.fromJSDate(new Date(this.expire || new Date())) ?? null
|
link.expire = DateTime.fromJSDate(new Date(this.expire || new Date())) ?? null
|
||||||
}
|
}
|
||||||
await link.save()
|
await link.save()
|
||||||
this.logger.info('The user was successfully updated!')
|
this.logger.info('The link was successfully updated!')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user