Allow editing status quote policy (#35762)
This commit is contained in:
18 files changed
+591
-16
No files matched your search
@@ -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,
|
||||
},
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user