From 4a22ca039ef9ad7e7060825c74fc29ac7058538b Mon Sep 17 00:00:00 2001 From: Felipe D'Abrantes <felidabrantes@gmail> Date: Sat, 25 Mar 2023 20:20:53 +0000 Subject: [PATCH] Remove likes parameter when creating a Daily --- .../feed-service/app/controllers/DailyController.scala | 2 +- backend-services/feed-service/app/models/Daily.scala | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/backend-services/feed-service/app/controllers/DailyController.scala b/backend-services/feed-service/app/controllers/DailyController.scala index 560b65d2..06401a9a 100644 --- a/backend-services/feed-service/app/controllers/DailyController.scala +++ b/backend-services/feed-service/app/controllers/DailyController.scala @@ -69,7 +69,7 @@ class DailyController @Inject()(val controllerComponents: ControllerComponents) try { // Dummy data - val result = Daily.createDailyAsync(None, new ObjectId("641128f7e80bcd1ba39d04ae"), new ObjectId("641128f7e80bcd1ba39d04ae"), "asddas", 221) + val result = Daily.createDailyAsync(None, new ObjectId("641128f7e80bcd1ba39d04ae"), new ObjectId("641128f7e80bcd1ba39d04ae"), "asddas") val jsonResult = Daily.toJson(result) Ok(jsonResult) } catch { diff --git a/backend-services/feed-service/app/models/Daily.scala b/backend-services/feed-service/app/models/Daily.scala index d7ac7f55..ef4ee4b7 100644 --- a/backend-services/feed-service/app/models/Daily.scala +++ b/backend-services/feed-service/app/models/Daily.scala @@ -32,11 +32,10 @@ object Daily { userId: ObjectId, questionId: ObjectId, content: String, - likes: Int = 0, timeout: Int = 4 ): Daily = { val now: Date = Date.from(Instant.now()) - val daily: Daily = Daily(None, userId, questionId, content, likes, now) + val daily: Daily = Daily(None, userId, questionId, content, 0, now, now) val future: Future[Daily] = dailyRepo.insertDaily(daily) Await.result(future, timeout.seconds) } -- GitLab