Allow editing status quote policy (#35762)

This commit is contained in:
Echo authored and GitHub committed 2025-08-14 15:04:32 +00:00
1 parent a2cddb9eac
commit 651e51a82e
18 files changed
+591 -16

No files matched your search

+19 -2
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,
},
);
};