Skip to content

Commit

Permalink
fixing views count on permanent links creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysn4Irix committed Jun 26, 2023
1 parent 652f4d7 commit 069449a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/$/[shortSlug]/+server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const GET = async ({ locals, params }) => {
link = await locals.pb.collection('links').getFirstListItem(`shortSlug="${params.shortSlug}"`)

if (link) {
if (parseInt(link.expiration) > Date.now()) {
if (parseInt(link.expiration) > Date.now() || link.expiration === 'Infinity') {
await locals.pb.collection('links').update(link.id, {
views: link.views + 1
})
Expand Down

0 comments on commit 069449a

Please sign in to comment.