From da18f42efd99ae82f1839794e9359e8128966948 Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Tue, 16 Nov 2021 18:04:26 +0100 Subject: [PATCH] Working --- app/Controllers/Http/LinksController.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Controllers/Http/LinksController.ts b/app/Controllers/Http/LinksController.ts index fc01006..3fb366f 100755 --- a/app/Controllers/Http/LinksController.ts +++ b/app/Controllers/Http/LinksController.ts @@ -41,11 +41,13 @@ export default class LinksController { const exist = await Redis.get(`${link.code}:${ip}:tracked`) if (!exist) { + console.log(request) + const getCountry = request.header('CF-IPCountry', '') await Redis.set(`${link.code}:${ip}:tracked`, 'true', 'ex', '3600') const click = await Click.create({ date: DateTime.now(), ip, - country: '' + country: getCountry }) await click.related('link').associate(link) await link.related('clicks').save(click)