aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/api/webhooks
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/www/api/webhooks')
-rw-r--r--src/main/java/com/juick/www/api/webhooks/VkWebhook.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/juick/www/api/webhooks/VkWebhook.java b/src/main/java/com/juick/www/api/webhooks/VkWebhook.java
index 45e20d3f..d69d00be 100644
--- a/src/main/java/com/juick/www/api/webhooks/VkWebhook.java
+++ b/src/main/java/com/juick/www/api/webhooks/VkWebhook.java
@@ -62,9 +62,9 @@ public class VkWebhook {
if (secretKey.equals(secret)) {
if (type.startsWith("donut_")) {
var vkId = json.get("object").get("user_id").asLong(0);
- var userId = userService.getUIDbyVKID(vkId);
- if (userId > 0) {
- vkService.updatePremiumStatus(userId);
+ var user = userService.getUserByVKID(vkId);
+ if (user.isPresent()) {
+ vkService.updatePremiumStatus(user.get().getUid());
}
}
return "ok";