Allow editing status quote policy (#35762)

This commit is contained in:
Echo 2025-08-14 17:04:32 +02:00 committed by GitHub
commit 651e51a82e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 591 additions and 16 deletions

View file

@ -1,5 +1,10 @@
import api, { getAsyncRefreshHeader } from 'mastodon/api';
import type { ApiContextJSON } from 'mastodon/api_types/statuses';
import api, { apiRequestPut, getAsyncRefreshHeader } from 'mastodon/api';
import type {
ApiContextJSON,
ApiStatusJSON,
} from 'mastodon/api_types/statuses';
import type { ApiQuotePolicy } from '../api_types/quotes';
export const apiGetContext = async (statusId: string) => {
const response = await api().request<ApiContextJSON>({
@ -12,3 +17,15 @@ export const apiGetContext = async (statusId: string) => {
refresh: getAsyncRefreshHeader(response),
};
};
export const apiSetQuotePolicy = async (
statusId: string,
policy: ApiQuotePolicy,
) => {
return apiRequestPut<ApiStatusJSON>(
`v1/statuses/${statusId}/interaction_policy`,
{
quote_approval_policy: policy,
},
);
};