From 519562c5c17c2adf7b9a378b128ff224caa32177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicole=20Miko=C5=82ajczyk?= Date: Thu, 17 Apr 2025 17:40:40 +0200 Subject: [PATCH] pl-api: idk why bites don't work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicole Mikołajczyk --- packages/pl-api/lib/client.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/pl-api/lib/client.ts b/packages/pl-api/lib/client.ts index fb28c4306..e0a6148d3 100644 --- a/packages/pl-api/lib/client.ts +++ b/packages/pl-api/lib/client.ts @@ -85,7 +85,7 @@ import { circleSchema } from './entities/circle'; import { type GroupedNotificationsResults, groupedNotificationsResultsSchema, type NotificationGroup } from './entities/grouped-notifications-results'; import { ShoutMessage, shoutMessageSchema } from './entities/shout-message'; import { filteredArray } from './entities/utils'; -import { AKKOMA, type Features, getFeatures, GOTOSOCIAL, MITRA, PIXELFED, PLEROMA } from './features'; +import { AKKOMA, type Features, getFeatures, GOTOSOCIAL, ICESHRIMP_NET, MITRA, PIXELFED, PLEROMA } from './features'; import request, { getNextLink, getPrevLink, type RequestBody, type RequestMeta } from './request'; import { buildFullPath } from './utils/url'; @@ -862,7 +862,15 @@ class PlApiClient { * @see {@link https://github.com/purifetchi/Toki/blob/master/Toki/Controllers/MastodonApi/Bite/BiteController.cs} */ biteAccount: async (accountId: string) => { - const response = await this.request('/api/v1/bite', { method: 'POST', params: { id: accountId } }); + let response; + switch (this.features.version.software) { + case ICESHRIMP_NET: + response = await this.request(`/api/v1/users/${accountId}/bite`, { method: 'POST' }); + break; + default: + response = await this.request('/api/v1/bite', { method: 'POST', params: { id: accountId } }); + break; + } return response.json as {}; },