From b4b83f2c947abf53ba3ce7938e245b403e793c46 Mon Sep 17 00:00:00 2001 From: spiral Date: Wed, 17 Nov 2021 09:52:58 -0500 Subject: [PATCH] fix(api): have correct behaviour for 'before' param --- PluralKit.API/Controllers/v2/SwitchControllerV2.cs | 2 +- docs/content/api/endpoints.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PluralKit.API/Controllers/v2/SwitchControllerV2.cs b/PluralKit.API/Controllers/v2/SwitchControllerV2.cs index d291991c..69d05457 100644 --- a/PluralKit.API/Controllers/v2/SwitchControllerV2.cs +++ b/PluralKit.API/Controllers/v2/SwitchControllerV2.cs @@ -47,7 +47,7 @@ namespace PluralKit.API select members.hid from switch_members, members where switch_members.switch = switches.id and members.id = switch_members.member ) as members from switches - where switches.system = @System and switches.timestamp <= @Before + where switches.system = @System and switches.timestamp < @Before order by switches.timestamp desc limit @Limit;", new { System = system.Id, Before = before, Limit = limit })); return Ok(res); diff --git a/docs/content/api/endpoints.md b/docs/content/api/endpoints.md index 2ac8b228..3b86628f 100644 --- a/docs/content/api/endpoints.md +++ b/docs/content/api/endpoints.md @@ -212,7 +212,7 @@ Query String Parameters |key|type|description| |---|---|---| -|before|timestamp|date to get latest switch from (inclusive)| +|before|timestamp|date to get latest switch from| |limit|int|number of switches to get| Returns a [switch object](/api/models#switch-model) containing a list of IDs.