You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
748 B
31 lines
748 B
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>({ |
|
method: 'GET', |
|
url: `/api/v1/statuses/${statusId}/context`, |
|
}); |
|
|
|
return { |
|
context: response.data, |
|
refresh: getAsyncRefreshHeader(response), |
|
}; |
|
}; |
|
|
|
export const apiSetQuotePolicy = async ( |
|
statusId: string, |
|
policy: ApiQuotePolicy, |
|
) => { |
|
return apiRequestPut<ApiStatusJSON>( |
|
`v1/statuses/${statusId}/interaction_policy`, |
|
{ |
|
quote_approval_policy: policy, |
|
}, |
|
); |
|
};
|
|
|