Skip to content

Commit

Permalink
fix(servers-service): rename 'to' parameter to 'limit'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ro0t-set committed May 21, 2024
1 parent 4002e9c commit 60b7010
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ open class ChannelService(
ChannelQuery.GetMessagesFromChannelId.Response(
channel.messages.subList(
request.from,
request.to.coerceAtMost(channel.messages.size)
request.limit.coerceAtMost(channel.messages.size)
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sealed interface ChannelQuery {
val serverId: ServerId,
val channelId: ChannelId,
val from: Int,
val to: Int,
val limit: Int,
override val requestFrom: String,
) : GetMessagesFromChannelId, ServiceRequest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class ChannelHttpController(private val channelService: ChannelService) : Channe
serverId: String,
channelId: String,
from: Int,
to: Int,
limit: Int,
principal: Principal,
): ChannelApi.GetChannelMessagesApi.Response {
val response =
Expand All @@ -118,7 +118,7 @@ class ChannelHttpController(private val channelService: ChannelService) : Channe
channelId = ChannelId(channelId),
serverId = ServerId(serverId),
from = from,
to = to
limit = limit
)
)
.getOrThrow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ interface ChannelHttpControllerApi {
@PathVariable serverId: String,
@PathVariable channelId: String,
@QueryValue from: Int,
@QueryValue to: Int,
@QueryValue limit: Int,
principal: Principal
): ChannelApi.GetChannelMessagesApi.Response

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ interface ChannelHttpClient {
@PathVariable serverId: String,
@PathVariable channelId: String,
@QueryValue from: Int,
@QueryValue to: Int,
@QueryValue limit: Int,
@Header(HttpHeaders.AUTHORIZATION) authorization: String = authOf("user")
): HttpResponse<ChannelApi.GetChannelMessagesApi.Response>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class ChannelHttpControllerTest(private var client: ChannelHttpClient) : Integra
serverId = basicServerId,
channelId = it,
from = 0,
to = 10
limit = 10
)
}
response.status() shouldBe HttpStatus.OK
Expand All @@ -182,7 +182,7 @@ class ChannelHttpControllerTest(private var client: ChannelHttpClient) : Integra
serverId = basicServerId,
channelId = "channelId",
from = 0,
to = 10
limit = 10
)
response.status() shouldBe HttpStatus.NOT_FOUND
}
Expand All @@ -195,7 +195,7 @@ class ChannelHttpControllerTest(private var client: ChannelHttpClient) : Integra
serverId = basicServerId,
channelId = channelId,
from = 0,
to = 10,
limit = 10,
authorization = authOf("anotherUser")
)
}
Expand Down

0 comments on commit 60b7010

Please sign in to comment.