pl-api: define support for status preview for mitra

Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
mkljczk
2025-03-27 12:52:16 +01:00
committed by Nicole Mikołajczyk
parent 10aa9e4381
commit d9f7844411
2 changed files with 7 additions and 1 deletions

View File

@ -2004,7 +2004,11 @@ class PlApiClient {
fixedParams.visibility = 'circle';
}
const response = await this.request('/api/v1/statuses', {
const input = params.preview && this.features.version.software === MITRA
? '/api/v1/statuses/preview'
: '/api/v1/statuses';
const response = await this.request(input, {
method: 'POST',
body: fixedParams,
});

View File

@ -472,10 +472,12 @@ const getFeatures = (instance: Instance) => {
/**
* @see POST /api/v1/statuses
* @see POST /api/v1/statuses/preview
*/
createStatusPreview: any([
v.software === AKKOMA,
v.software === PLEROMA,
v.software === MITRA,
]),
/**