Skip to content
Snippets Groups Projects
Commit 4a22ca03 authored by Felipe D'Abrantes's avatar Felipe D'Abrantes
Browse files

Remove likes parameter when creating a Daily

parent 79697830
No related branches found
No related tags found
1 merge request!14Add endpoints to manage Dailies
...@@ -69,7 +69,7 @@ class DailyController @Inject()(val controllerComponents: ControllerComponents) ...@@ -69,7 +69,7 @@ class DailyController @Inject()(val controllerComponents: ControllerComponents)
try { try {
// Dummy data // 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) val jsonResult = Daily.toJson(result)
Ok(jsonResult) Ok(jsonResult)
} catch { } catch {
......
...@@ -32,11 +32,10 @@ object Daily { ...@@ -32,11 +32,10 @@ object Daily {
userId: ObjectId, userId: ObjectId,
questionId: ObjectId, questionId: ObjectId,
content: String, content: String,
likes: Int = 0,
timeout: Int = 4 timeout: Int = 4
): Daily = { ): Daily = {
val now: Date = Date.from(Instant.now()) 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) val future: Future[Daily] = dailyRepo.insertDaily(daily)
Await.result(future, timeout.seconds) Await.result(future, timeout.seconds)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment