Allow editing status quote policy (#35762)
This commit is contained in:
parent
a2cddb9eac
commit
651e51a82e
18 changed files with 591 additions and 16 deletions
|
|
@ -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,
|
||||
},
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue